#include <bits/stdc++.h>

using namespace std;

#define el				'\n'
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define maxnode         100000+9

double const EPS = 1e-8, PI = acos(-1);
const int N = 100000 + 9, M = 30 + 7, OO = (int) 1e6 + 1;
const long long MOD = 1e9 + 7, INF = 1e18 + 9;

typedef long long ll;
typedef long double lld;
typedef vector<int> vi;
void OUTPUT() {
	cout << fixed << setprecision(12);
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

void INPUT() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}


int main() {
	INPUT();
	OUTPUT();

	int t;cin>>t;
	while(t--){
		int n;
		cin>>n;

		int arr[n];
		for(int i=0;i<n;i++){
			cin>>arr[i];
		}
		int x=arr[0];
		for(int i=1;i<n;i++){
			if(arr[i]==arr[i-1]){
				x=arr[i];
			}

		}
		for(int i=0;i<n;i++){
			if(arr[i]!=x){
				cout<<i+1<<el;
				break;

			}

		}

	}






	return 0;
}


