# -*- coding: utf-8 -*- text = input() text = text.replace('hamu', '1') text = text.replace('ham', '0') num = int(text, 2) text = bin(num * 2)[2:].replace('1', 'hamu') text = text.replace('0', 'ham') print(text)