H, W = map(int, input().split()) for _ in [0] * H: print(input().replace("yiwiy9", "yiwiY9").replace("9yiwiy", "9Yiwiy"))