fn c() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); s.trim().to_string() } fn o() -> i64 { println!("? 1 1"); c().parse().unwrap() } fn main() { let (mut x, mut y, mut d) = (1, 1, 0); let f: Vec = c().split_whitespace().flat_map(str::parse).collect(); match f.as_slice() { [1, 1] => println!("! 1 1"), [1, _] => { d = o(); y = (1..=f[1]).find(|&y| (y - 1).pow(2) == d).unwrap(); } [_, 1] => { d = o(); x = (1..=f[0]).find(|&x| (x - 1).pow(2) == d).unwrap(); } _ => { let u = o(); println!("? 1 {}", f[1]); let v = c().parse::().unwrap(); d = (u - v - 1 + f[1].pow(2)) / 2; y = (d / (f[1] - 1)).abs(); x = (1..=f[0]) .find(|&x| (y - 1).pow(2) + (x - 1).pow(2) == u) .unwrap(); } } println!("! {x} {y}"); }