s = input() print(s+s) while True: t, u = input().split() if t == "!": break else: print("?", u[-1]+s)