#CCBCHBAHAI0000148. Chỉ số của phần tử lớn nhất (Index of the Maximum Element)

Chỉ số của phần tử lớn nhất (Index of the Maximum Element)

Index of the Maximum Element

Source: C Primer Plus

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer array A=(a0,a1,…,an−1)A=(a_0,a_1,\ldots,a_{n-1}) indexed from 00 to n−1n-1, find the smallest index pp such that apa_p equals the maximum value of the array. Thus, when the maximum occurs more than once, choose its first occurrence.

Input

  • The first line contains an integer nn.
  • The second line contains nn integers a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}.

Output

Print one integer, the 00-based index pp of the first occurrence of the maximum value.

Subtasks

Subtask 1 (100 points): 1≤n≤1051\le n\le10^5 and −109≤ai≤109-10^9\le a_i\le10^9.

Examples

Input

7
4 9 2 9 7 1 9

Output

1

Explanation

The maximum value is 99, occurring at indices 1,3,61,3,6. The smallest of these indices is 11, so the answer is 1.