import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = read().rstrip().decode() S = S.replace('hamu','1').replace('ham','0') x = int(S, 2) x *= 2 S = bin(x)[2:].replace('1','hamu').replace('0','ham') print(S)