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.io.*;
public class Code_force3 {
	public static boolean[] visited;
	public static int max=0;
	public static int size=0;
	public static int[] arr;
	public static int x;
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		for(int t=0;t<N;t++) {
			x = Integer.parseInt(br.readLine());
			arr = new int[x];
			max=0;
			int min =210000000;
			StringTokenizer st = new StringTokenizer(br.readLine());
			for(int i=0;i<x;i++) {
				arr[i]=Integer.parseInt(st.nextToken());
				if(arr[i]>max)
					max=arr[i];
				if(min>arr[i])
					min=arr[i];
			}
			for(int i=0;i<x;i++) {
				visited=new boolean[x];
				size=arr[i];				
				visited[i]=true;
				dfs(i);
				if(size>max) {
					System.out.println(i+1);
					break;
				}
				if(i==x-1)
					System.out.println("-1");
			}
			System.out.println("---------------------");
		}
		
	}
	public static void dfs(int start) {
		System.out.println("!start :  "+ start);
		if(size>max)
			return;
			if(isPossible(start-1)&&!visited[start-1]&&size>arr[start-1]) {
				size++;
				visited[start-1]=true;
				if(size>max)
					return;
				System.out.println(start -1);
				dfs(start-1);
			}
			if(isPossible(start+1)&&!visited[start+1]&&size>arr[start+1]) {
				size++;
				visited[start+1]=true;
				if(size>max)
					return;
				System.out.println(start+1);
				dfs(start+1);
			}
	}
	public static boolean isPossible(int t) {
		if(t<0||t>=x) {
			return false;
		}
		return true;
	}
}
