def solve(): numarr = ["hamu", "ham"] s = input() numstr = "" for idx in range(2): s = s.replace(numarr[idx], str(1 - idx)) ansnum = int(s, 2) * 2 ans = [] while ansnum > 0: ans.append(numarr[(ansnum & 1) ^ 1]) ansnum >>= 1 print("".join(ans[::-1])) if __name__=="__main__": solve()