# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll s = raw_input() print raw_input() + "ham" if s != "ham" else "ham"