H, W = (int(x) for x in input().split()) for _ in range(H): print(input().replace("9yiwiy", "9Yiwiy").replace("yiwiy9", "yiwiY9"))