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

var tests = parseInt(readline());
for (var test = 0; test < tests; test++) {
  var size = parseInt(readline()), input = readline().split(' '), max = 0, pos = new Map();
  input.forEach((v, i) => {
    input[i] = parseInt(v);
    if (input[i] > max) {
      if (max > 0)
        pos.delete(max);
      max = input[i];
      pos.set(max, [i]);
    }
    else if (input[i] == max) {
      var temp = pos.get(max);
      temp.push(i);
      pos.set(max, temp);
    }
  });
  var result = -1, pos = pos.get(max);
  for (var i = 0; i < pos.length; i++) {
    var cur = pos[i];
    if (cur < size - 1) {
      if (input[pos[i]] > input[pos[i]+1]) {
        result = pos[i];
        break;
      }
    }
    if (cur > 0) {
      if (input[pos[i]] > input[pos[i]-1]) {
        result = pos[i];
        break;
      }
    }
  }
  print(result);
}