import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.next(); s = s.replace("hamu","1"); s = s.replace("ham","0"); s = s + "0"; s = s.replace("1","hamu"); s = s.replace("0","ham"); System.out.println(s.equals("hamham")==false?s:"ham"); } }