// Problem: A. Spy Detected!
// Contest: Codeforces - Codeforces Round #713 (Div. 3)
// URL: https://codeforces.com/problemset/problem/1512/A
// Memory Limit: 256 MB
// Time Limit: 2000 ms

# include <bits/stdc++.h>
using namespace std;
# define ll long long

vector<int> into_arr (int n, vector<int> arr) {
	int ncount = n;
	while (ncount--) {
		int temp; 
		cin >> temp;
		arr.push_back(temp);
	}
	return arr;
}

void output_vector (vector<int> arr) {
	for (int output_vector_index = 0; output_vector_index < arr.size(); output_vector_index++) {
		cout << arr[output_vector_index] << ' ';
	}
	cout << endl;
}

void testcase () {
	int n;
	cin >> n;
	vector<int> A;
	A = into_arr (n, A);
	
	vector<int> Acopy = A;
	
	sort (Acopy.begin(), Acopy.end());
	if (Acopy[0] == Acopy[1]) {
		auto it = find (A.begin(), A.end(), (Acopy[n - 1]));
		cout << it - A.begin() + 1 << endl;
	} else {
		auto it = find (A.begin(), A.end(), (Acopy[0]));
		cout << it - A.begin() + 1 << endl;
	}
	return;
	
}

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	int t; cin >> t;
	while (t--) {
		testcase ();
	}
	
	//testcase();
}

