H, W = map(int, input().split()) for i in range(H): s = list(input()) pos = 0 while pos < W: if s[pos] == '9': s[pos + 1] = 'Y' pos += 6 elif s[pos] == 'y': s[pos + 4] = 'Y' pos += 6 else: pos += 1 print(''.join(s))