import sys, time, random, heapq, math, itertools, copy from collections import deque, Counter, defaultdict from bisect import bisect, bisect_left, bisect_right import heapq as hq from functools import cache, cmp_to_key def debug(*x):print('debug:',*x, file=sys.stderr) sys.setrecursionlimit(300000) input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 dir = [(0, 1), (0, -1), (1, 0), (-1, 0)] H, W = mi() S = [list(input()) for _ in range(H)] for i in range(H): cnt = 0 for j in range(len(S[i])): if cnt > 0: cnt -= 1 continue if j + 5 < len(S[i]): if "".join(S[i][j:j+6]) == "yiwiy9": S[i][j] = "y"; S[i][j+1] = "i"; S[i][j+2] = "w"; S[i][j+3] = "i"; S[i][j+4] = "Y"; S[i][j+5] = "9" cnt = 5 if "".join(S[i][j:j+6]) == "9yiwiy": S[i][j] = "9"; S[i][j+1] = "Y"; S[i][j+2] = "i"; S[i][j+3] = "w"; S[i][j+4] = "i"; S[i][j+5] = "y" cnt = 5 for i in range(H): print("".join(S[i]))