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[1000001]{0};
int mas[1000001]{0};
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, max, s = 0, ans = -1;
    cin >> n;
    cin >> a[0];
    max = a[0];
    for (int q = 1; q < n; q++) {
      cin >> a[q];
      if (a[q] > max) max = a[q];
    }
    int i = 0;
    bool k = false;
    for (int q = 0; q < n; q++)
      if (a[q] == max) {
        s++;
        mas[i] = q;
        i++;
      }
    if (mas[0] == 0 && a[mas[0]] > a[mas[0] + 1]) {
      cout << mas[0] + 1 << endl;
      continue;
    }
    for (int u = 1; u < s - 1; u++) {
      if (a[mas[u]] > a[mas[u] + 1] || a[mas[u]] > a[mas[u] - 1]) {
        cout << mas[u] + 1 << endl;
        k = true;
        break;
      }
    }
    if (k) continue;
    if (!k) {
      cout << mas[s - 1] + 1 << endl;
      continue;
    }
    cout << ans << endl;
  }
  return 0;
}
