//qentan9lement
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define mod 1000000007
#define INF 0x3f3f3f3f
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace std;

void solve()
{
    ll n;cin>>n; map<ll,ll>mp;
    ll arr[n];for(ll i=0;i<n;i++)cin>>arr[i],mp[arr[i]]++;
    ll minn=INF,flag=0;
    for(auto i:mp)
    {
        if(i.second==1)
        {
          minn=min(minn,i.first);
          flag=1;
        }
    }
    if(flag){for(ll i=0;i<n;i++)if(arr[i]==minn){cout<<i+1<<endl;return;}}
    else cout<<-1<<endl;
}
int main()
{
    ios;
    ll tc=1; cin>>tc;
    while(tc--)
    solve();
}
