#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
	int n;
	cin >> n;
	vector<int> v(n);
	map<int, vector<int>> mp;
	for (int i = 0; i < n; i++) {
		cin >> v[i];
		mp[v[i]].push_back(i + 1);
	}
	for (auto itr = mp.begin(); itr != mp.end(); itr++) {
		if (itr->second.size() == 1) {
			cout << itr->second[0] << endl;
			break;
		}
	}

}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t = 1;
	cin >> t;
	while (t--) solve();
	return 0;
}

