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