1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<cmath>
#define ll long long int
#define f(i,j,n) for(ll i=j;i<n;i++)
#define yes() cout<<"YES"<<endl;
#define no() cout<<"NO"<<endl;
#define CASE(T) ll T;cin>>T;while(T--)
using namespace std;

int main()
{
	CASE(t)
	{
		ll n;
		cin>>n;
		ll a[n];
		for(ll i=0;i<n;i++)
		{
			cin>>a[i];
		}
		ll b[n]={};
		for(ll i=0;i<n;i++)
		{
			b[i]=a[i];
		}
		sort(b,b+n);
		if(b[n-1]>b[n-2])
		{
			for(ll i=0;i<n;i++)
			{
				if(a[i]==b[n-1])
				{
					cout<<i+1<<endl;
					break;
				}
			}
		}
		else if(b[n-1]>b[0])
		{
			bool b1=0;
			for(ll i=0;i<n;i++)
			{
				if(a[i]==b[n-1]&&((i+1<n)&&a[i+1]<b[n-1]))
				{
					b1=1;
					cout<<i+1<<endl;
				}
				if(a[i]==b[n-1]&&((i-1>=0)&&a[i-1]<b[n-1]))
				{
					b1=1;
					cout<<i+1<<endl;
				}
			}	
		}
	}
	return 0;
}


