#include <bits/stdc++.h>

using namespace std;

#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define int long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define MOD 1000000007

const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};

signed main()
{
    fast_IO;
    //freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
    int test = 1;
    cin >> test;
    while(test--)
    {
        int n;
        cin >> n;
        int a[n];
        map<int, int> mp;
        for(int i = 0; i < n; i++)
            cin >> a[i], mp[a[i]]++;
        int mn = INT_MAX;
        for(auto x: mp)
        {
            if(x.S == 1)
                mn = min(mn, x.F);
        }
        
        int ans = -1;
        for(int i = 0; i <= n; i++)
        {
            if(a[i] == mn)
            {
                ans = i + 1;
                break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}
