H,W=map(int,input().split()) for i in range(H): TMP=input() print(TMP.replace("y9","Y9").replace("9y","9Y"))