#include <bits/stdc++.h>
#define int long long

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>*/

using namespace std;


signed main() {
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);
    //cout.tie(0);
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; ++i) cin >> a[i];
    vector <pair <int, pair <int, int> > > goga;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (a[i] > a[j]) goga.push_back({a[i] - a[j], {i, j}});
            else goga.push_back({a[j] - a[i], {j, i}});
        }
    }
    sort(goga.begin(), goga.end());
    reverse(goga.begin(), goga.end());
    for (int i = 0; i < goga.size(); ++i) {
        if (goga[i].first >= 0 && i < goga.size()) {
        int first = goga[i].second.first, second = goga[i].second.second;
        cout << "? " << first + 1 << " " << second + 1 << endl;
        string lol;
        cin >> lol;
        if (lol == "Yes") {
            cout << "! " << first + 1 << " " << second + 1 << endl;
            return 0;
        }
        }
    }
    cout << "! " << 0 << " " << 0 << endl;
    return 0;
}
