num = gets.scan(/hamu?/).map{|z| z[-1] == 'u' ? 1 : 0} num << 0 unless num.size == 1 && num[0] == 0 puts num.map{|z| z == 0 ? 'ham' : 'hamu'}.join