/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include <cstring>
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 500000000LL
#define EPS 0.00000001
#define pi 3.14159
ll mod=1000000007LL;

template<class A=ll> 
void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;}

template<class A=ll>
void In(vector<A> &a, ll N) {A cur; REP(i,0,N) {cin>>cur; a.pb(cur);}} 

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll N; cin>>N; vector<ll> k; In(k,N);
	vector<pair<ll,pl> > op; 
	REP(i,0,N)
	{
		REP(j,0,N)
		{
			if(i==j) {continue;}
			if(k[j]>k[i]) {continue;}
			op.pb({k[i]-k[j],{i+1,j+1}});
		}
	}
	sort(whole(op)); reverse(whole(op));
	string ans;
	REP(i,0,op.size())
	{
		cout<<"? "<<op[i].ss.ff<<" "<<op[i].ss.ss<<endl;
		cin>>ans;
		if(ans=="Yes") {cout<<"! "<<op[i].ss.ff<<" "<<op[i].ss.ss<<endl; return 0;}
	}
	cout<<"! 0 0"<<endl;
    return 0;
}