using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (h, w) = (c[0], c[1]); var s = SList(h); var ans = new char[h][]; var l = "yiwiy9"; var r = "9yiwiy"; for (var i = 0; i < h; ++i) { ans[i] = s[i].ToCharArray(); for (var j = 0; j + 6 <= w; ++j) { var flg = true; for (var b = 0; b < 6; ++b) if (ans[i][j + b] != l[b]) flg = false; if (flg) ans[i][j + 4] = 'Y'; flg = true; for (var b = 0; b < 6; ++b) if (ans[i][j + b] != r[b]) flg = false; if (flg) ans[i][j + 1] = 'Y'; } } WriteLine(string.Join("\n", ans.Select(ai => string.Concat(ai)))); } }