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;
long long see_for_0(long long *arr, long long n) {
  long long s = arr[0];
  for (long long i = 1; i < n; i++) {
    if (s <= arr[i]) return 0;
    s++;
  }
  return 1;
}
long long see_for_n_1(long long *arr, long long n) {
  long long s = arr[n - 1];
  for (long long i = n - 2; i >= 0; i--) {
    if (s <= arr[i]) return 0;
    s++;
  }
  return 1;
}
long long final(long long *arr, long long n) {
  long long ans = -1;
  vector<long long> prefix_max(n);
  vector<long long> suffix_max(n);
  for (long long i = n - 1; i >= 0; i--) {
    if (i != n - 1)
      suffix_max[i] = max(suffix_max[i + 1], arr[i]);
    else
      suffix_max[i] = arr[i];
  }
  for (long long i = 0; i < n; i++) {
    if (i != 0)
      prefix_max[i] = max(prefix_max[i - 1], arr[i]);
    else
      prefix_max[i] = arr[i];
  }
  long long a, b;
  for (long long i = 0; i < n; i++) {
    long long current_size = arr[i];
    if (i == n - 1) return -1;
    if (i == 0) continue;
    a = i - 1;
    b = i + 1;
    while (a >= 0 && b < n) {
      if (current_size <= arr[a] && current_size <= arr[b]) {
        break;
      } else if (current_size > prefix_max[a] && current_size > suffix_max[b]) {
        ans = i;
        return (ans + 1);
        break;
      }
      if (current_size > arr[a]) {
        a--;
        current_size++;
      }
      if (current_size > arr[b]) {
        b++;
        current_size++;
      }
    }
    if (ans != -1) {
      return (ans + 1);
    }
    if (a < 0 && b >= n) {
      ans = i;
      break;
    } else if (a < 0) {
      if (current_size > suffix_max[b]) {
        ans = i;
        break;
      }
    } else if (b >= n) {
      if (current_size > prefix_max[a]) {
        ans = i;
        break;
      }
    }
  }
  if (ans != -1) {
    return (ans + 1);
  }
  return -1;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  long long t;
  cin >> t;
  long long prefix_maxv = 0;
  map<long long, long long> m;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n];
    long long ans = 0, current_size = 0;
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    long long index = -1;
    long long a = see_for_0(arr, n);
    if (a == 1) {
      cout << 1 << endl;
      continue;
    }
    a = see_for_n_1(arr, n);
    if (a == 1) {
      cout << n << endl;
      continue;
    }
    index = final(arr, n);
    if (index == -1)
      cout << index << endl;
    else
      cout << index << endl;
  }
  return 0;
}
