#K466. Warrior Competition Winner

    ID: 28012 Type: Default 1000ms 256MiB

Warrior Competition Winner

Warrior Competition Winner

In this problem, you are given a list of warriors along with their respective strengths. The competition proceeds by eliminating warriors one by one until only one remains. In each step, the warrior with the highest strength is selected as the dominant fighter. If multiple warriors share the maximum strength, the warrior appearing earliest (i.e. with the smallest index) is chosen.

You are required to determine the 1-indexed position of the winning warrior. Formally, given a list \( S = [s_1, s_2, \dots, s_N] \), find the smallest index \( i \) such that \( s_i = \max\{s_1, s_2, \dots, s_N\} \).

inputFormat

The input is read from standard input (stdin) and consists of two lines. The first line contains a single integer (N) representing the number of warriors. The second line contains (N) space-separated integers denoting the strengths of the warriors.

outputFormat

Output a single integer to standard output (stdout) representing the 1-indexed position of the winning warrior.## sample

5
4 3 6 7 5
4