cin >> n; for (int i = 1; i <= n; ++i) cin >> d[i]; for (int i = 1; i <= n; ++i) for (int j = i + 1; j <= n; ++j) a[++cnt] = { i, j }; for (int i = 1; i <= cnt; ++i) if (d[a[i].x] < d[a[i].y]) swap(a[i].x, a[i].y); sort(a + 1, a + cnt + 1); for (int i = 1; i <= cnt; ++i) { int x = a[i].x, y = a[i].y; string s; cout << "? " << x << " " << y << endl; cin >> s; if (s == "Yes") returncout << "! " << x << " " << y << endl, 0; } cout << "! 0 0" << endl; return0; }