import java.util.*;import java.math.*;import java.io.*;publicclassMain{staticclassSolution{int N, dir[][]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};char[][] g, res;boolean[] vis;char[] s ="yizhong".toCharArray();voiddfs(int x,int y){for(int k =0; k <8; k++){boolean match =true;for(int i =1; i <=6; i++){int tx = x + i * dir[k][0];int ty = y + i * dir[k][1];if(tx <0|| tx >= N || ty <0|| ty >= N || s[i]!= g[tx][ty]){
match =false;break;}}if(!match)continue;for(int i =0; i <=6; i++){int tx = x + i * dir[k][0], ty = y + i * dir[k][1];
res[tx][ty]= g[tx][ty];}}}voidinit(){
Scanner sc =newScanner(newBufferedInputStream(System.in));
N = sc.nextInt();
g =newchar[N+1][N+1];
res =newchar[N+1][N+1];for(int i =0; i < N; i++){
String s = sc.next();for(int j =0; j < N; j++)
g[i][j]= s.charAt(j);}for(int i =0; i < N; i++){for(int j =0; j < N; j++)if(g[i][j]=='y')dfs(i, j);}for(int i =0; i < N; i++){for(int j =0; j < N; j++)
System.out.print(res[i][j]==0?"*": res[i][j]);
System.out.println();}}}publicstaticvoidmain(String[] args)throws IOException {
Solution s =newSolution();
s.init();}}