n = input() n_2 = n.replace("hamu","1").replace("ham","0") print(n_2) n_10 = int(n_2,2) result_2 = (bin(n_10 * 2)).replace("0b","") print(result_2) print(result_2.replace("1","hamu").replace("0","ham"))