#include<bits/stdc++.h>
#include<iostream>

using namespace std;

int main()
{
	//cout<<"SSDN";
	//checking first three will ensure baap element kaun hai.
	int t,n;
	cin>>t;
	while(t)
	{
		cin>>n;
		int x;
		std::vector<int> v;
		for(int i=0;i<n;i++)
		{
			cin>>x;
			v.push_back(x);
		}
		int a=v[0];
		int b=v[1];
		int c=v[2];
		int baap=-1;
		if(a==b)
			baap=a;
		else if(a==c)
			baap=a;
		else
			baap=b;
		for(int i=0;i<v.size();i++)
			if(v[i]!=baap)
			{
				cout<<i+1<<endl;
				break;
			}
		
		t--;
	}
	return 0;
}