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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class C {

  public static void main(String[] args) {
    int T = 0;
    FastReader reader = new FastReader();
    BufferedWriter write = new BufferedWriter(new OutputStreamWriter(System.out));
    T = reader.nextInt();
    while (T-- > 0) {
      try {
        dominantPiranha(reader, write);
        write.flush();
      } catch (Exception ex) {
        System.out.println("invalid");
      }
    }
  }

  private static void dominantPiranha(FastReader reader, BufferedWriter writer) throws IOException {
    int n = 0, max = 0, index = 0, curValue = 0, output = -1;
    long sum = 0;
    int[] piranhaSize = null;
    n = reader.nextInt();
    piranhaSize = new int[n];
    StringTokenizer tokenizer = new StringTokenizer(reader.nextLine(), " ");
    while (tokenizer.hasMoreTokens()) {
      curValue = Integer.parseInt(tokenizer.nextToken());
      sum += curValue;
      if (max < curValue) {
        max = curValue;
      }
      piranhaSize[index++] = curValue;
    }
    if (((long)piranhaSize[0]) * n == sum) {
      output = -1;
    } else {
      for (index = 0; index < n; index++) {
        if (piranhaSize[index] == max) {
          if (index != 0 && piranhaSize[index - 1] < piranhaSize[index]) {
            output = index + 1;
            break;
          } else if (index < n - 1 && piranhaSize[index] > piranhaSize[index + 1]) {
            output = index + 1;
            break;
          }
        }
      }
    }
    writer.write(output + "\n");
  }

  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;
    }
  }
}
