H, W = map(int, input().split()) G = [input() for _ in range(H)] ANS = [] for s in G: s = s.replace("yiwiy9", "yiwiY9") s = s.replace("9yiwiy", "9Yiwiy") ANS.append(s) print(*ANS, sep="\n")