/*
#include <stdio.h>
int main()
{
int arr[26][26]={};
int i,j,k,p,sum=0;
//SCANF=========================
for (i=1;i<=25;i++)
{
for (j=1;j<=25;j++)
{
scanf("%d",&arr[i][j]);
}
}
//================================
for (i=1;i<=25;i++)
{
for (j=1;j<=25;j++)
{
for(x=i-1;x<=i+1;x++)
for(y=j-1;y<=j+1;y++)
sum+=arr[x][y];
//sum=arr[i][j-1]+arr[i][j+1]+arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1];
if (arr[i][j]==1)
{
}
else
{
}
}
}
return 0;
}
#include <stdio.h>
int main()
{
int arr[26][26]= {}, arr1[26][26]={};
int i,j,k,p,sum=0;
//SCANF=========================
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
scanf("%d",&arr[i][j]);
}
}
//================================
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
sum=arr[i][j-1]+arr[i][j+1]+arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1];
if (arr[i][j]==1)
{
if (sum>=4 || sum<=1)
{
arr1[i][j]=0;
}
else if (sum==2 || sum==3)
{
arr1[i][j]=1;
}
}
else if (arr[i][j]==0)
{
if (sum==3)
{
arr1[i][j]=1;
}
}
}
}
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
printf("%d ",arr1[i][j]);
}
printf("\n");
}
return 0;
}
*/
#include<stdio.h>
int main()
{
int arr[101][101]= {};
int i,j,n,x,y,k=0;
scanf("%d\n%d %d",&n,&x,&y);
arr[x][y]=1;
for (j=y-1; j>=1; j--)
{
arr[x][j]=arr[x][j+1]+1;
}
for (j=y+1; j<=n; j++)
{
arr[x][j]=arr[x][j-1]+1;
}
for (i=x+1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
arr[i][j]=arr[i-1][j]+1;
}
}
for (i=x-1;i>=1;i--)
{
for (j=1;j<=n;j++)
{
arr[i][j]=arr[i+1][j]+1;
}
}
for (i=1; i<=n; i++)
{
for (j=1; j<=n; j++)
{
printf("%d ",arr[i][j]);
}
printf("\n");
}
}
/*
#include <stdio.h>
int main()
{
int arr[26][26]={};
int i,j,k,p,sum=0;
//SCANF=========================
for (i=1;i<=25;i++)
{
for (j=1;j<=25;j++)
{
scanf("%d",&arr[i][j]);
}
}
//================================
for (i=1;i<=25;i++)
{
for (j=1;j<=25;j++)
{
for(x=i-1;x<=i+1;x++)
for(y=j-1;y<=j+1;y++)
sum+=arr[x][y];
//sum=arr[i][j-1]+arr[i][j+1]+arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1];
if (arr[i][j]==1)
{
}
else
{
}
}
}
return 0;
}
#include <stdio.h>
int main()
{
int arr[26][26]= {}, arr1[26][26]={};
int i,j,k,p,sum=0;
//SCANF=========================
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
scanf("%d",&arr[i][j]);
}
}
//================================
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
sum=arr[i][j-1]+arr[i][j+1]+arr[i-1][j-1]+arr[i-1][j]+arr[i-1][j+1]+arr[i+1][j-1]+arr[i+1][j]+arr[i+1][j+1];
if (arr[i][j]==1)
{
if (sum>=4 || sum<=1)
{
arr1[i][j]=0;
}
else if (sum==2 || sum==3)
{
arr1[i][j]=1;
}
}
else if (arr[i][j]==0)
{
if (sum==3)
{
arr1[i][j]=1;
}
}
}
}
for (i=1; i<=25; i++)
{
for (j=1; j<=25; j++)
{
printf("%d ",arr1[i][j]);
}
printf("\n");
}
return 0;
}
*/
#include<stdio.h>
int main()
{
int arr[101][101]= {};
int i,j,n,x,y,k=0;
scanf("%d\n%d %d",&n,&x,&y);
arr[x][y]=1;
for (j=y-1; j>=1; j--)
{
arr[x][j]=arr[x][j+1]+1;
}
for (j=y+1; j<=n; j++)
{
arr[x][j]=arr[x][j-1]+1;
}
for (i=x+1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
arr[i][j]=arr[i-1][j]+1;
}
}
for (i=x-1;i>=1;i--)
{
for (j=1;j<=n;j++)
{
arr[i][j]=arr[i+1][j]+1;
}
}
for (i=1; i<=n; i++)
{
for (j=1; j<=n; j++)
{
printf("%d ",arr[i][j]);
}
printf("\n");
}
}