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 += numarr[ansnum & 1] ansnum >>= 1 print(ans) if __name__=="__main__": solve()