# No.423 ハムスター語初級(数詞) n = input() s = n.replace('hamu', '1').replace('ham', '0') d = 0 answer = '' for i in range(len(s)): d += 2 ** i * int(s[len(s) - i - 1]) d *= 2 while d != 1: answer = 'hamu' + answer if d % 2 == 1 else 'ham' + answer d //= 2 print('hamu' + answer)