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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define AB_BHI_NI_DEGI                \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define int long long
#define pb push_back
#define N 200009
#define inf 1e18
const double PI = 3.141592653589793238462643383279;
int mod = 1e9 + 7;
//int mod = 998244353;
#define P pair<int, int>
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define vi vector<int>
#define ld long double

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

void in_a(int a[], int start, int end)
{
    for (int i = start; i <= end; i++)
        cin >> a[i];
}
void in_v(vector<int> &a, int start, int end)
{
    for (int i = start; i <= end; i++)
        cin >> a[i];
}
void solve()
{
    int n;
    cin >> n;
    int a[n];
    in_a(a, 0, n - 1);
    priority_queue<pair<int, int>> pq;
    for (int i = 0; i < n; i++)
        pq.push({a[i], i});
    if (n < 2)
    {
        cout << "1\n";
        return;
    }
    int x = pq.top().S;
    int all = 0;
    for (int i = 0; i < n; i++)
        all += a[i] == a[x];
    if (all == n)
        cout << "-1\n";
    else
        cout << x + 1 << "\n";
}
int32_t main()
{
    AB_BHI_NI_DEGI
    int Test = 1;
    cin >> Test;
    //init();
    int cnt = 1;
    while (Test--)
    {
        //cout << "Case #" << cnt++ << ": ";
        solve();
    }
    return 0;
}