/*
	author: parv2809
*/

#include<bits/stdc++.h>
#define int long long int
#define mod 1000000007
#define inf 1e18
#define cin(t) int t;cin>>t
#define w(t) while(t--)
#define nl cout<<"\n";
#define N 200005
#define M 23
#define vvi vector<vector<int> >
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define ft(i) (i&(-1*i))
#define arrIn(arr,size)		for(int i=0;i<size;i++){cin>>arr[i];}
#define arrOut(arr,size,seperater)	for(int i=0;i<size;i++){cout<<arr[i]<<seperater;}
using namespace std;

int max(int a, int b) {
	if (a > b)
		return a;
	return b;
}

int min(int a, int b) {
	if (a < b)
		return a;
	return b;
}

int powmd(int a, int b) {
	if (b == 1)	return a;
	if (b == 0)	return 1;

	int half = powmd(a, b / 2);
	int ans = half * half;
	ans %= mod;
	if (b & 1) {
		ans *= a;
	}
	ans %= mod;
	return ans;
}

void fastIO() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif

}

typedef pair<int, pair<int, int> > tuplee;

void solve() {

	int n;
	cin >> n;
	vector<int> indegree(n);

	arrIn(indegree, n);

	vector<tuplee> arr;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (indegree[i] > indegree[j]) {
				tuplee curr = mp(indegree[i] - indegree[j], mp(i, j));
				arr.pb(curr);
				continue;
			}
			tuplee curr = mp(indegree[j] - indegree[i], mp(j, i));
			arr.pb(curr);
		}
	}

	sort(arr.rbegin(), arr.rend());

	for (auto it : arr) {
		cout << "? " << it.second.first + 1 << " " << it.second.second + 1 << endl;
		string ans;
		cin >> ans;
		if (ans == "Yes") {
			cout << "! " << it.second.second + 1 << " " << it.second.first + 1 << endl;
			return;
		}
	}
	cout << "! 0 0" << endl;
	return;
}

int32_t main() {

	fastIO();
	int t = 1;
	w(t) {
		solve();
	}

	return 0;
}

// cout << "Case #" << i << ": " << answer << endl;