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

import java.io.*;
import java.util.*;
 
public class c {
    static class FastReader { 
      BufferedReader br; 
      StringTokenizer st; 
 
      public FastReader(){ 
          br = new BufferedReader(new
                   InputStreamReader(System.in)); 
      } 
 
      String next(){ 
          while (st == null || !st.hasMoreElements()){ 
              try{ 
                  st = new StringTokenizer(br.readLine()); 
              }catch (IOException  e){ 
                  e.printStackTrace(); 
              } 
          } 
          return st.nextToken(); 
      } 
 
      int nextInt(){ 
          return Integer.parseInt(next()); 
      } 
 
      long nextLong(){ 
          return Long.parseLong(next()); 
      } 
 
      double nextDouble(){ 
          return Double.parseDouble(next()); 
      } 
 
      String nextLine(){ 
          String str = ""; 
          try{ 
              str = br.readLine(); 
          }catch (IOException e){ 
              e.printStackTrace(); 
          } 
          return str; 
      } 
  }
  public static void main(String[] args) {
  	FastReader in = new FastReader(); 
    int a = in.nextInt();
    int count = 0;
    int min = 0;
    int max = 0;
    boolean joni = false;
    int [] res = new int [a];
    int [] ar = new int [a];
    for(int i=0;i<a;i++){
      int b = in.nextInt();
      int [] arr = new int [b];
      Integer [] list = new Integer [b];
      for(int j=0;j<b;j++){     
        arr[j] = in.nextInt();
        list[j] = arr[j];
      }
      min = (int) Collections.min(Arrays.asList(list));
      max = (int) Collections.max(Arrays.asList(list));
      for(int j=0;j<b-1;j++){
        if(min==max){
          res[i] = -1;
        }
        else if(min+1<max){
          if(arr[j]==min){
            count = j;
            if(arr[count+1] == min+1){
              res[i] = count+1;
            }
            else {
              res[i] = count-1;
            }
          }
        }
        else{
          if(arr[j] == min){
            res[i]=min+1;
          }
        }
      }
    }
    for(int i=0;i<a;i++){
      System.out.println(res[i]);
    }
  }
}