from string import ascii_lowercase a = ascii_lowercase from collections import defaultdict mp = defaultdict(list) for s in a: for t in a: mp[s].append(s+t) alpha = input() while True: for candidate in mp[alpha]: tail = candidate[1] if len(mp[tail]): print('?',mp[alpha].pop()) break res = input() if res == '! WIN': exit() content = res.split()[1] alpha = content[1]