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;
const int N = 3 * 1e5 + 10;
int a[N];
int x, y, n;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int k = 1;
    scanf("%d", &n);
    int f = 0, ma, ans;
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (i == 1) ma = a[i];
      if (a[i] >= ma) k = i;
      if (a[i] != ma) f = 1;
    }
    if (!f)
      ans = -1;
    else {
      for (int i = 1; i <= n; i++) {
        if ((a[i] == a[k]) && ((a[i - 1] != a[k] && i - 1 >= 1) ||
                               (a[i + 1] != a[k] && i + 1 <= n)))
          ans = i;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
