#include <bits/stdc++.h>

using namespace std;

void solve(){
	int n;

	cin >> n;

	int v[n];

	for (int i = 0; i < n; ++i)
	{
		cin >> v[i];
	}

	for (int i = 0; i < n; ++i)
	{
		int flag = 1;

		for (int j = 0; j < n ; ++j)
		{
			if(j != i){

				if(v[i] == v[j]){
					j = n-1;
					flag = 0;
				}

			}
		}

		if(flag){

			cout << i+1 << endl;
			break;
		}

	}

}


int main(){

	int t;

	cin >> t;

	while(t--){

		solve();
	} 

	return 0;
}