#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{ ll t;
  cin>>t;
  while(t--)
   { ll n;
     cin>>n;
     ll a[n];
     for(ll i=0;i<n;i++)
       { cin>>a[i];
	   }
	  ll x;
     if(a[1]==a[0])
	  { x=a[1];
	   
        for(ll i=0;i<n;i++)
         {  if(a[i]!=x)
          { cout<<i+1<<endl;
            break;
		  }
	     }
      }
     else
      { if(a[2]==a[0])
         { cout<<"2"<<endl;
		 }
	    else
	     { cout<<"1"<<endl;
		 }
	  }
   
   }

}    
