import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char n[] = new char[51]; n = sc.next().toCharArray(); sc.close(); int length = n.length, tmp1[] = new int[16], tmp2 = 0, i, j = 0; for (i = 0; i < length - 3; ++i) { if (n[i] == 'h' && n[i + 1] == 'a' && n[i + 2] == 'm' && n[i + 3] != 'u') { tmp1[j] = 0; i += 2; } else { tmp1[j] = 1; i += 3; } ++j; } if (n[length - 3] == 'h' && n[length - 2] == 'a' && n[length - 1] == 'm') { tmp1[j] = 0; ++j; } for (i = 0; i < j; ++i) { if (tmp1[j - i - 1] == 1) tmp2 += (int)Math.pow(2, i); } tmp2 *= 2; j = 0; for (i = 31; i >= 0; --i) { if ((tmp2 >> i & 1) == 1) { System.out.print("hamu"); j = 1; } else if (j == 1) System.out.print("ham"); } if (j == 0) System.out.print("ham"); } }