h, w = map(int, input().split()) s = [list(input()) for _ in range(h)] for i in range(h): j = 0 while j < len(s[i]) - 1: if s[i][j] == "9" and s[i][j + 1] == "y": s[i][j + 1] = "Y" s[i][j + 5] = "0" elif s[i][j] == "y" and s[i][j + 1] == "9": s[i][j] = "Y" s[i][j + 1] = "1" j += 1 for line in s: ans = line j = 0 while j < len(ans): if ans[j] == "0": ans[j] = "y" elif ans[j] == "1": ans[j] = "9" j += 1 print("".join(ans))