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 main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int n, i, temp, x, flag = 0;
    cin >> n;
    int a[n];
    cin >> temp;
    a[0] = temp;
    int max = a[0];
    for (i = 1; i < n; i++) {
      cin >> temp;
      a[i] = temp;
      if (a[i] != a[i - 1]) {
        flag = 1;
      }
      if (max < temp) {
        max = temp;
      }
    }
    if (flag == 0) {
      cout << "-1" << '\n';
      continue;
    }
    flag = 0;
    int ans = -1;
    for (i = 0; i < n; i++) {
      if (a[i] == max) {
        if (i + 1 != n && i - 1 != -1) {
          if (a[i + 1] != max || a[i - 1] != max) {
            ans = i + 1;
            break;
          }
        } else {
          if (i + 1 == n && i - 1 == -1) {
            ans = i + 1;
            break;
          }
          if (i - 1 == -1 && a[i + 1] != max) {
            ans = i + 1;
            break;
          }
          if (i + 1 == n && a[i - 1] != max) {
            ans = i + 1;
            break;
          }
        }
      }
    }
    if (ans != -1)
      cout << ans << '\n';
    else
      cout << "-1" << '\n';
  }
  return 0;
}
