#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int a[100];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
if (a[0] != a[1]) {
if (a[0] == a[2]) {
cout << 2 << endl;
} else {
cout << 1 << endl;
}
} else {
for (int i = 2; i < n; ++i) {
if (a[i] != a[0]) {
cout << i + 1 << endl;
break;
}
}
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKICAgIGludCB0OwogICAgY2luID4+IHQ7CiAgICB3aGlsZSAodC0tKSB7CiAgICAgICAgaW50IG47CiAgICAgICAgY2luID4+IG47CiAgICAgICAgaW50IGFbMTAwXTsKCiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyArK2kpIHsKICAgICAgICAgICAgY2luID4+IGFbaV07CiAgICAgICAgfQoKICAgICAgICBpZiAoYVswXSAhPSBhWzFdKSB7CiAgICAgICAgICAgIGlmIChhWzBdID09IGFbMl0pIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgMiA8PCBlbmRsOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgY291dCA8PCAxIDw8IGVuZGw7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBmb3IgKGludCBpID0gMjsgaSA8IG47ICsraSkgewogICAgICAgICAgICAgICAgaWYgKGFbaV0gIT0gYVswXSkgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgaSArIDEgPDwgZW5kbDsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gMDsKfQ==