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.regex.Pattern;
public class Stub {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt(); // ??
int hi, lo;

for (int i=0; i<n; i++) {  //  Cases

    hi = 0;
    lo = 1000000000;
    int x = in.nextInt(); 
    int p[] = new int[x];
    for (int j = 0; j<x; j++) {
        p[j] = in.nextInt();
        hi = Math.max(hi, p[j]);
        lo = Math.min(lo, p[j]);
    }
    if (hi == lo) System.out.println("-1");
    else {
        int q=0;
        while (p[q] < hi) q++;
        System.out.println(q);
    }
    
} // end for i

} // end main
}
