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.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.IntToLongFunction;
import java.lang.*;
import java.io.*;
import java.math.*;
public final class CF
{
    public static void main(String[]args)throws IOException
    {
        FastReader ob=new FastReader();
        int t=ob.nextInt();
        StringBuffer sb=new StringBuffer();
        while(t-->0)
        {
            int n=ob.nextInt();
            int a[]=new int[n];
            for(int i=0;i<n;i++)
            a[i]=ob.nextInt();
                
            int ans=-1;
            for(int i=1;i<n;i++)
            {
                if(a[i]>a[i-1])
                {
                    ans=i+1;
                    break;
                }
            }
            if(ans==-1){
            for(int i=0;i<n-1;i++)
            {
                if(a[i]>a[i+1])
                {
                    ans=i+1;
                    break;
                }
            }}
            sb.append(ans+"\n");
        }
        System.out.println(sb);
    }
}
class Pair implements Comparable<Pair>
{
    int x,y;
    Pair(int x,int y)
    {
        this.x=x;
        this.y=y;
    }
    @Override
    public int compareTo(Pair a) {
        return a.y-y;
    }
}
class FastReader {
     BufferedReader br;
     StringTokenizer st;
     public FastReader() {
         br = new BufferedReader(new InputStreamReader(System.in));
     }
 
     public String next() {
         while (st == null || !st.hasMoreElements()) {
             try {
                 st = new StringTokenizer(br.readLine());
             } catch (IOException e)  {
                 e.printStackTrace();
             }
         }
         return st.nextToken();
     }
     public String nextLine()
     {
         String s="";
         try {
         s=br.readLine();
         } catch (IOException e)  {
                 e.printStackTrace();
             }
         return s;
     }
     public int nextInt() {
         return Integer.parseInt(next());
     }
     public long nextLong() {
         return Long.parseLong(next());
     }
     public double nextDouble() {
         return Double.parseDouble(next());
     }
 }
 