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