#include<bits/stdc++.h>
using namespace std;
typedef int ll;
#define f first
#define s second
void solve(){
   ll ans=0;
   ll n,k;
   cin>>n;
   vector<pair<ll,pair<ll,ll>> > queries;
   vector<ll> a(n);
   for(int i=0;i<n;i++) {
       cin>>a[i];
       for(ll j=i-1;j>=0;j--) {
           
               if(a[j]<=a[i]) queries.push_back({abs(a[j]-a[i]),{i+1,j+1}});
               else queries.push_back({abs(a[j]-a[i]),{j+1,i+1}});
       }
   }
   sort(queries.begin(),queries.end());
   reverse(queries.begin(),queries.end());
   for(auto it:queries) {
       cout<<"? "<<it.s.f<<" "<<it.s.s<<endl;
       string s;
       cin>>s;
       if(s=="Yes") {
           cout<<"! "<<it.s.f<<" "<<it.s.s<<endl;
           return;
       }
   }
   cout<<"! 0 0"<<endl;
}
int main() {
    int t=1;
    //cin>>t;
    int i=1;
    while(t--) {
        //cout<<"Case #"<<i<<": ";
        solve();
        i++;
    }
    return 0;
}
