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

			}
	    }
	}
}