/*#include<stdio.h>
int main()
{
int map[15][15]= {};
int k;
int player;
int x[100];
int y[100];
int i,j;
int up = 0;
int down = 0;
int left = 0;
int right = 0;
int balloon;
for(int i = 1; i <= 10; i ++)
{
for(int j = 1; j <= 10; j ++)
{
scanf("%d",&map[i][j]);
}
}
scanf("%d", &player);
for(i=1; i<=player; i++)
{
scanf("%d %d", &x[i], &y[i]);
}
for(int i = 1; i <= 10; i ++)
{
for(int j = 1; j <= 10; j ++)
{
if(map[i][j] > 0)
{
int balloon = map[i][j];
up = 0;
down = 0;
left = 0;
right = 0;
for(int k = 1; k<= balloon; k++)
{
map[i][j] = -2;
if(map[i+k][j] != -1 && down == 0 && map[i+k][j]<=0)
{
map[i+k][j] = -2;
}
else if(map[i+k][j] == -1)
{
down = 1;
}
if(map[i-k][j] != -1 && up == 0 && map[i-k][j]<=0 )
{
map[i-k][j] = -2;
}
else if(map[i-k][j] == -1)
{
up = 1;
}
if(map[i][j-k] != -1 && left == 0 && map[i][j-k]<=0)
{
map[i][j-k] = -2;
}
else if(map[i][j-k] == -1)
{
left = 1;
}
if(map[i][j+k] != -1 && right == 0 && map[i][j+k]<=0)
{
map[i][j+k] = -2;
}
else if(map[i][j+k] == -1)
{
right = 1;
}
}
}
}
}
for(int i=1; i<=10; i++)
{
for(int j=1; j<=10; j++)
{
printf("%d ", map[i][j]);
}
printf("\n");
}
printf("Character Information\n");
for(i=1; i<=player; i++)
{
if(map[x[i]][y[i]]==-2)
{
printf("player %d dead\n", i);
}
else
{
printf("player %d survive\n", i);
}
}
}*/
#include<stdio.h>
int main()
{
int anthouse[15][15]; // 0 ~14
int ant;
int food = 1;
int way = 9;
int i,j;
int x,y;
for(i=1; i<=10; i++)
{
for(j=1; j<=10; j++)
{
scanf("%d", &anthouse[i][j]);
for(i=1; i<=ant; i++)
{
if(anthouse[x+1][y]!=1)
{
printf("9");
}
}
}
}
}