#pragma GCC optimize(2)
#include <bits/stdc++.h> 
#include <memory>
using namespace std;
#define sf(a) scanf("%d",&a)
#define pf(a) printf("%d",a)
#define ford(i,a,n) for(i=a;i<=n;i++)
#define forb(i,n,a) for(i=n;i>=a;i--)
#define mst(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
#define pb push_back
#define ddd cout<<"ddd"<<endl
#define maxn 500010
#define inf 0x7fffffff
const ll mod=1e9+7;
struct point{
	int x,y;
	int res;
}k[maxn];
int cmp(point a,point b)
{
	if(a.res==b.res)
	{
		if(a.x>b.x)
		return a.y>b.y;
		return a.x>b.x;
	}
	return a.res>b.res;
}
int a[maxn];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	//ddd;
	int n;
	cin>>n;
	int i,j;
	int amount=0;
	ford(i,1,n)
	{
		cin>>a[i];
	}
	ford(i,1,n)
	ford(j,i+1,n)
	{
		k[++amount].x=i;
		k[amount].y=j;
		k[amount].res=abs(a[i]-a[j]);
		if(a[i]<a[j])
		swap(k[amount].x,k[amount].y);
	}
	sort(k+1,k+amount+1,cmp);
	ford(i,1,amount)
	{
		cout<<"? "<<k[i].x<<" "<<k[i].y<<endl;
		cout.flush();
		string op;
		cin>>op;
		if(op=="Yes")
		{
			cout<<"! "<<k[i].x<<" "<<k[i].y;
			return 0;
		}
	}
	cout<<"! 0 0";
}