import re H, W = map(int, input().split()) grid = [] for _ in range(H): s = input() for c in s: if c == '.': continue if c == '9': s = re.sub("9yiwiy", "9Yiwiy", s) elif c == 'y': s = re.sub("yiwiy9", "yiwiY9", s) grid.append(s) for g in grid: print(g)