#include <stdio.h>
#include <conio.h>

int n;
long **a;

int find_not_nill(int i,int j){
	int d=1;
	int cont=0;//false
	int fuckoff=0;
	int found = 0;

	do{
		int x=j-d,y=i;
		cont = 0;
		for(;(y<=i-d)&&(!fuckoff);x++,y--)
			/*time critical*/
			if( (y>=0) && (y<n) && (x>=0) && (x<n) &&
			   (a[y][x]) ){
				cont=1;
				if(found) fuckoff=1;
				found = a[y][x];
			}
		for(;(x<=j+d)&&(!fuckoff);x++,y++)
			/*time critical*/
			if( (y>=0) && (y<n) && (x>=0) && (x<n) &&
			   (a[y][x]) ){
				cont=1;
				if(found) fuckoff=1;
				found = a[y][x];
			}
		for(;(y<=i+d)&&(!fuckoff);x--,y++)
			/*time critical*/
			if( (y>=0) && (y<n) && (x>=0) && (x<n) &&
			   (a[y][x]) ){
				cont=1;
				if(found) fuckoff=1;
				found = a[y][x];
			}
		for(;(x>=i-d)&&(!fuckoff);x--,y--)
			/*time critical*/
			if( (y>=0) && (y<n) && (x>=0) && (x<n) &&
			   (a[y][x]) ){
				cont=1;
				if(found) fuckoff=1;
				found = a[y][x];
			}

		if(found) break;
		d++;
	}while(cont);
	if(found&&!fuckoff) return found;
	return 0;
}

int main(void){
	FILE *in,*o;
	in = fopen("input.txt","r");
	o = fopen("output.txt","w");


	int i,j;

	fscanf(in,"%d",&n);
	a = new long*[n];


	for(i=0;i<n;i++){
		a[i] = new long[n];
		for(j=0;j<n;j++){
			long x=0;
			fscanf(in,"%d",&x);
			a[i][j]=x;
			printf("a[%d][%d]=%d\n",i,j,a[i][j]);
		}
	}

	for(i=0;i<n;i++){
		for(j=0;j<n;j++)
			printf("a[%d][%d]=%d\n",i,j,a[i][j]);
			if(a[i][j]==0){
				printf("found 0\n");
//				long int k=find_not_nill(i,j);
//				fprintf(o,"%d ",a[i][j]+1);
				fprintf(o,"x ");
			}//else fprintf(o,"%d ",a[i][j]);
		fprintf(o,"\n");
	}

	fclose(in);
	fclose(o);

	return 0;
}