#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define N 505
using namespace std;
int n,T;
typedef pair<int,int> Pr;
Pr k[N];
struct node{
    int l,r,val;
    bool operator<(const node o)const{
        return val>o.val;
    }
}a[N*N];
int main(){
    cin>>n;
    rep(i,1,n)cin>>k[i].first,k[i].second=i;
    sort(k+1,k+n+1);
    int j=1;
    while(j<=n&&k[j].first==0){
        rep(u,j+1,n)k[u].first--;
        j++;
    }
    rep(x,j,n)rep(y,x+1,n)a[++T].l=k[x].second,a[T].r=k[y].second,a[T].val=k[y].first-k[x].first;
    sort(a+1,a+T+1);
    rep(i,1,T){
        cout<<"? "<<a[i].r<<" "<<a[i].l<<endl;
        string op;cin>>op;
        if(op=="Yes"){cout<<"! "<<a[i].l<<" "<<a[i].r<<endl;return 0;}
    }
    cout<<"! 0 0"<<endl;
    return 0;
} 