use std::io::Write; fn main() { let alpha = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse::().unwrap() }; let mut prev = alpha.repeat(2); loop { println!("? {}", prev.chars().rev().collect::()); std::io::stdout().flush().unwrap(); let (symbol, t) = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse::().unwrap(), iter.next().unwrap().parse::().unwrap(), ) }; if symbol == '!' { break; } prev = t.to_string(); } }