#include #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { string s; int ok = 0, ng = 1000, D = -1; while (ok + 1 < ng) { int x = (ok + ng) / 2; if (D != -1 && x % D == 0) { x++; if (x == ng) break; } cout << "? " << x << "\n"; cin >> s; if (s == "safe") { ok = x; continue; } cout << "? " << x + 1 << "\n"; cin >> s; if (s == "out") { ng = x; } else { ok = x + 1; } } cout << "! " << ok << "\n"; }