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

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define fr(i,k) for(i=0;i<k;i++)
#define deb(x) cerr<<#x<<"  = "<<x<<endl;
#define deb2(x,y) cerr<<#x<<" ="<<x<<endl<<#y<<" ="<<y<<endl;
#define SZ(x) (x).size();
#define ll long long
#define mod 1000000007
#define ff first
#define ss second
#define pb push_back
#define em emplace_back
#define ulli unsigned long long int
#define inf 1e18
#define endl "\n"
typedef vector<vector<ll>> vvll;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
void solve();
void pre();

int main() {
	fastio;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll t;
	t = 1;

	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}


inline void solve()
{
	ll n, i, ans, j, f = 0;
	cin >> n;

	ll a[n];
	map<ll, ll> m;

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

	for (auto k : m)
	{
		if (k.second == 1)
		{
			f = 1;
			j = k.first;
			break;
		}
	}

	if (f)
	{
		for (i = 0; i < n; i++)
		{
			if (a[i] == j)
			{
				cout << i + 1 << endl;
			}
		}
	}
	else
		cout << -1 << endl;

}

