#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define inf 27e17
#define int long long int
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define f first
#define s second
#define N 1000
 
int nCrModp(int n, int r, int p) 
{ 
    if(n<r)
        return 0;
    // Optimization for the cases when r is large 
    if (r > n - r) 
        r = n - r; 
  
    // The array C is going to store last row of 
    // pascal triangle at the end. And last entry 
    // of last row is nCr 
    int C[r + 1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; // Top row of Pascal Triangle 
  
    // One by constructs remaining rows of Pascal 
    // Triangle from top to bottom 
    for (int i = 1; i <= n; i++) { 
  
        // Fill entries of current row using previous 
        // row values 
        for (int j = min(i, r); j > 0; j--) 
  
            // nCj = (n-1)Cj + (n-1)C(j-1); 
            C[j] = (C[j] + C[j - 1]) % p; 
    } 
    return C[r]; 
}
 /*
int modFact(int n, int p) 
{ 
    if (n >= p) 
        return 0; 
  
    int result = 1; 
    for (int i = 1; i <= n; i++) 
        result = (result * i) % p; 
  
    return result; 
}*/ 
/*int power(int x, int y,int m) {
    int temp;
    if( y == 0||x==1)
        return 1;
    temp = power(x, y/2,m)%m;
    if (y%2 == 0)
        return ((temp)*(temp))%m;
    else
        return (((x)%m)*((temp*temp)%m))%m;
}*/
int power(int x, int y) {
    int temp;
    if( y == 0||x==1)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return ((temp)*(temp));
    else
        return (((x))*((temp*temp)));
}
 /*
int maxSubArraySum(int a[], int size) 
{ 
    int max_so_far = INT_MIN, max_ending_here = 0; 
  
    for (int i = 0; i < size; i++) 
    { 
        max_ending_here = max_ending_here + a[i]; 
        if (max_so_far < max_ending_here) 
            max_so_far = max_ending_here; 
  
        if (max_ending_here < 0) 
            max_ending_here = 0; 
    } 
    return max_so_far; 
}
int gcd(int a, int b)  
{  
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
}   
int lcm(int a, int b)  
{  
    return (a*b)/gcd(a, b);  
}  
*/
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int a[n];
        unordered_map<int,int>m;
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            m[a[i]]++;
        }
        int num;
        for(auto it=m.begin();it!=m.end();it++)
        {
            if(it->s == 1)
                num=it->f;
        }
        for(int i=0;i<n;i++)
        {
            if(a[i]==num)
            {
                cout<<i+1<<"\n";
                break;
            }
        }
    }
}

 			  		 	     	  		