/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int map [105][105] = {0};
int i,j,r,c,sum=0;
for(i=1; i<=9; i++)
{
for(j=1; j<=9; j++)
{
scanf ("%d",&map [i][j]);
}
}
scanf ("%d %d",&r,&c);
if(map[r][c]==1)
{
sum=-1;
}
else
{
sum=map[r-1][c-1]+map[r-1][c]+map[r-1][c+1]+map[r][c-1]+map[r][c+1]+map[r+1][c-1]+map[r+1][c]+map[r+1][c+1];
}
printf ("%d",sum);
return 0;
}
*/
/*
#include<stdio.h>
int i,j;
struct loc
{
int x,y;
};
char map[15][15] = {0};
char map1[15][15] = {0};
struct loc location[100000] = {0};
int front,rear;
void f1()
{
int x = location[front].x;
int y = location[front].y;
front++;
if(x==0 || y==0 || x==10 || y==10)
return;
int sum = 0;
if(map[x][y]=='1') return ;
for(i=-1; i<=1; i++)
{
for(j=-1; j<=1; j++)
{
if(map[x+i][y+j]=='1')
{
sum++;
}
}
}
if(sum>0)
{
map1[x][y] = sum+'0';
return ;
}
}
int main()
{
int k,n,i,j;
int x,y;
int front = rear = 0;
int map[15][15] = {0},map1[15][15] = {0};
for(i=1; i<=9; i++)
{
for(j=1; j<=9; j++)
{
scanf ("%d",&map[i][j]);
map1[i][j] = '_';
}
}
scanf ("%d %d",&x,&y);
if(map[x][y]=='1')
{
for(i=1; i<=9; i++)
{
for(j=1; j<=9; j++)
{
if(x==i&&y==j)
{
printf ("-1");
}
else
{
printf ("_ ");
}
}
printf ("\n");
}
return 0;
}
else
{
location[rear].x = x;
location[rear].y = y;
for(;front!=rear;)
{
f1();
}
}
for(i=1; i<=9; i++)
{
for(j=1; j<=9; j++)
{
if(map[i][j]==-1)
{
printf("-1 ");
}
else
{
printf ("%c ", map1[i][j]);
}
}
printf ("\n");
}
}
*/