using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicord423 { class Program { static void Main(string[] args) { string line = Console.ReadLine(); int idx = 0; string num = ""; string ans = ""; if (leadingZero(line)) { Console.WriteLine(line); Environment.Exit(0); } while (idx < line.Length - 1) { if (idx + 4 <= line.Length) { if (line.Substring(idx , 4) == "hamu") { num += "1"; idx += 4; } else { num += "0"; idx += 3; } } else { num += "0"; idx += 3; } } num += "0"; ans = num.Replace("1" , "hamu"); ans = ans.Replace("0" , "ham"); Console.WriteLine(ans); Console.ReadKey(); } static bool leadingZero(string s) { if (s.Length < 4) return true; if (s.Substring(0 , 4) != "hamu") return true; return false; } } }