#include <iostream>
#include "vector"
#include <algorithm>
#include <set>
#include <math.h>
#include "numeric"

using ull = unsigned long long;

using namespace std;


int main() {
    int n; cin >> n;

    vector<int> k(n);
    for (auto & ki : k) {
        cin >> ki;
    }


    vector<pair<int, pair<int, int>>> test;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (k[i] > k[j]) {
                test.emplace_back((-k[i] + k[j]), make_pair(i, j));
            } else {
                test.emplace_back((-k[j] + k[i]), make_pair(j, i));
            }
        }
    }

    sort(test.begin(), test.end());

    for (auto & t : test) {
        int a = t.second.first;
        int b = t.second.second;

        cout << "? " << a  + 1 << " " << b + 1 << endl;
        cout.flush();

        std::string answer; cin >> answer;
        if (answer == "Yes") {
            cout << "! " << a + 1 << " " << b + 1 << endl;
            cout.flush();
            return 0;
        }
    }

    std::cout << "! 0 0" << endl;
    cout.flush();

    return 0;
}
