h,w=map(int, input().split()) S=[input().replace('9yiwiy', '9Yiwiy').replace('yiwiy9', 'yiwiY9') for i in range(h)] for i in S: print(i)