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>
using namespace std;
#define ll long long
#define ar array

void solve(){
    int n;
    vector<int> a(n);
    for(auto &it:a){
        cin>>it;
    }
    
    if (adjacent_find(a.begin(), a.end(), not_equal_to<>() ) == a.end()){
    cout << "-1" << endl;
    }

    else{
        for(int j=0;j<n;j++){
            if(j==0){
                if(a[j]>a[1]){
                    cout<<j<<endl;
                    break;
                }
            }
            else if(j==(n-1)){
                if(a[j]>a[j-1]){
                    cout<<j<<endl;
                    break;
                }
            }
            else{
                if(a[j]>a[j-1] || a[j]>a[j+1]){
                    cout<<j<<endl;
                    break;
                }
                
            }
        }
    }
}


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin >> t;
    while(t--)
        solve();
    return 0;
}