/*
 
    ----@sagittarius_k2-----
    Created by Ritesh Ranjan
    ->
 
*/
 
#define fio                          \
   ios_base::sync_with_stdio(false); \
   cin.tie(NULL);                    \
   cout.tie(NULL);
 
#include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <algorithm>
#include <iterator>
 
 
using namespace std;
 
#define int long long int
 
#define M 1000000007
 
using namespace std;
 
signed main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int a[n+1], b[n+1];
        for(int i=1; i<=n; i++)
        {
            cin>>a[i];
            b[i]=a[i];
        }
        sort(a+1, a+n+1);

        int ans=-1, min_no=-1;
        for(int i=1; i<=n; i++)
        {
            int c=0;
            while(i<n && a[i]==a[i+1])
            {
                i++;
                c++;
            }
            if(c==0)
            {
                min_no=a[i];
                break;
            }
        }
        for(int i=1; i<=n; i++)
        {
            if(b[i]==min_no)
            {
                ans=i;
                break;
            }
        }
        cout<<ans<<"\n";
    }
}