fn query (x: u64) -> bool { println!("? {}", x); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim() == "out" } fn main() { let mut safe = 0; let mut out = 1000; while out - safe > 1 { let m = (safe + out) / 2; if query(m) && query(m + 1) { out = m; } else { safe = m; } } let ans = if !query(safe + 1) { safe + 1} else { safe }; println!("! {}", ans); }