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.*;

public class Main
{
  public static void main (String[] args) throws java.lang.Exception
  {
      Scanner obj = new Scanner(System.in);
      int T = obj.nextInt();
      while (T-- > 0)
      {
          int n = obj.nextInt();
          int[] a = new int[n];
          int flag = 0, max = Integer.MIN_VALUE, ind = 0;
          for (int i = 0; i < n; i++)
          {
              a[i] = obj.nextInt();
              if (a[i] > max)
              {
                  max = a[i];
                  ind = i + 1;
              }
          }
          for (int i = 0; i < n - 1; i++)
              if (a[i] != a[i + 1])
              {
                  flag = 1;
                  break;
              }
          if (flag == 0)
              System.out.println(-1);
          else
          {
              for (int i = ind - 1; i < n - 1; i++)
              {
                  if (a[i] == a[i + 1])
                      ind++;
                  else
                      break;
              }
              System.out.println(ind);
          }
      }
  }
}