S = input().replace("hamu","1").replace("ham","0")
a = int(S, 2)
ans = (bin(a * 2)[2:]).replace("1","hamu").replace("0","ham")
print(ans)