use std::io::Write; fn query(x: usize, y: usize) -> usize { println!("? {} {}", x, y); std::io::stdout().flush().unwrap(); let mut input = String::new(); std::io::stdin().read_line(&mut input).ok(); let mut input = input.split_whitespace(); input.next().unwrap().parse().unwrap() } fn main() { let mut input = String::new(); std::io::stdin().read_line(&mut input).ok(); let mut input = input.split_whitespace(); let n: usize = input.next().unwrap().parse().unwrap(); for i in 0..(n / 2) { let x = i * 2; let y = x + 1; let z = query(x, y); if z == x { println!("! {}", y); return; } else if z == y { println!("! {}", x); return; } } println!("! {}", n - 1); }