S = input() if S == "ham": print(S) else: print(input()+"ham")