#include #include #include using namespace std; int main() { int N; cin >> N; vector P(N - 1); for (int i = 0; i < N - 1; ++i) { cout << "? " << i << " " << N - 1 << endl; cin >> P[i]; if (P[i] == -1) return 0; } vector candidates; for (int k = 1; k <= 9; ++k) { string current_x = ""; bool ok = true; for (int i = 0; i < N - 1; ++i) { if (P[i] % k != 0 || P[i] / k > 9) { ok = false; break; } current_x += to_string(P[i] / k); } if (ok) { string full_x = ""; full_x += to_string(k); for (int i = N - 2; i >= 0; --i) { full_x += current_x[i]; } string candidate = ""; candidate += to_string(k); for(int i = N - 2; i >= 0; --i) { candidate += to_string(P[i] / k); } candidates.push_back(candidate); } } if (candidates.size() == 1) { cout << "! " << candidates[0] << endl; } else { cout << "! -1" << endl; } return 0; }