H, W = map(int, input().split()) for i in range(H): s = input().replace('9yiwiy','9Yiwiy').replace('yiwiy9', 'yiwiY9') print(s)