require "set" class Start def main _ = input puts "? aa" s = Set["aa"] while true x = input.split[1] break if x.include?("WIN") if x[0] != "a" || s.include?(x) _ = input break end t = x[-1] + "a" s.add x s.add t echo "? #{t}" end end protected def echo(*x) print(*x) puts end def input = gets.chomp end Start.new.main