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

#include <bits/stdc++.h>

#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define in(x) int (x); input((x));
#define x first
#define y second
#define less(a,b) ((a) < (b) - EPS)
#define more(a,b) ((a) > (b) + EPS)
#define eq(a,b) (fabs((a) - (b)) < EPS)
#define remax(a, b) ((a) = (b) > (a) ? (b) : (a))
#define remin(a, b) ((a) = (b) < (a) ? (b) : (a))

using namespace std;

template <typename T>
T gcd(T a, T b)
{
    while (b > 0)
    {
        a %= b;
        swap(a, b);
    }
    return a;
}

typedef long double ld;
typedef unsigned int uint;
template <class _T> inline _T sqr(const _T& x)
{
    return x * x;
}
template <class _T> inline string tostr(const _T& a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
const ld PI = 3.1415926535897932384626433832795L;
const double EPS = 1e-9;
char TEMPORARY_CHAR;

typedef long long ll;
typedef unsigned long long ull;
typedef set < int > SI;
typedef vector < int > VI;
typedef vector < vector < int > > VVI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;
const int INF = 1e9;
inline void input(int &a)
{
    a = 0;
    while (((TEMPORARY_CHAR = getchar()) > '9' || TEMPORARY_CHAR < '0') && (TEMPORARY_CHAR != '-')) {} char neg = 0;
    if (TEMPORARY_CHAR == '-')
    {
        neg = 1;
        TEMPORARY_CHAR = getchar();
    }
    while (TEMPORARY_CHAR <= '9' && TEMPORARY_CHAR >= '0')
    {
        a = 10 * a + TEMPORARY_CHAR - '0';
        TEMPORARY_CHAR = getchar();
    }
    if (neg) a = -a;
}
inline void out(long long a)
{
    if (!a) putchar('0');
    if (a < 0)
    {
        putchar('-');
        a = -a;
    }
    char s[20];
    int i;
    for(i = 0; a; ++i)
    {
        s[i] = '0' + a % 10;
        a /= 10;
    }
    ford(j, i) putchar(s[j]);
}
inline int nxt()
{
    in(ret);
    return ret;
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#else

#endif
    ios_base::sync_with_stdio(false);
    int n;
    cin>>n;
    while(n--)
    {
        int t;
        cin>>t;
        int arr[t+1]= {};
        for(int i=1; i<=t; i++)cin>>arr[i];
        if(set<int>(arr+1,arr+t+1).size()==1)
        {
            cout<<"-1"<<endl;
            continue;
        }
        int m=*max_element(arr,arr+n+1);
        int sol=0;
        for(int i=1;i<n+1;i++){
            if((arr[i]==m&&arr[i]!=arr[i+1])||(arr[i]==m&&arr[i]!=arr[i-1]))
                {
                    sol=i;
                    break;
                }
        }
        cout<<sol<<endl;
    }


#ifdef LOCAL
    cerr << "Time elapsed: " << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms.\n";
#endif // LOCAL
    return 0;
}
