H, W = gets.split.map(&:to_i) puts Array.new(H) { gets.chomp.gsub(/yiwiy9/, "yiwiY9").gsub(/9yiwiy/, "9Yiwiy") }