1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

#include <bits/stdc++.h>
using namespace std;
int a[300005];
int n, m, ans, cc, ma;
int find() {
  a[0] = a[n + 1] = 1e9 + 1;
  for (int i = 1; i <= n; i++)
    if (a[i] == ma and (a[i] > a[i - 1] or a[i] > a[i + 1])) return i;
  return -1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], ma = max(ma, a[i]);
  cout << find();
}
