import java.util.*; class Question423 { public static void main(String[] str){ Scanner scan = new Scanner(System.in); String s = scan.next(); String bin,ham; if(s.equals("ham")){ System.out.println("ham"); } else{ bin = s.replaceAll("hamu","1"); bin = bin.replaceAll("ham","0"); bin += "0"; ham = bin.replaceAll("0","ham"); ham = ham.replaceAll("1","hamu"); System.out.println(ham); } } }