#include <stdio.h>
#include <stdlib.h>
/*int main()
{
int k[1000] = {};
int n;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d", &k[i]);
}
for(int i=0; i<n; i+=2)
{
if(k[i]<k[i+1]){printf("%d ", k[i]);}
else if(k[i]>k[i+1]){printf("%d ", k[i+1]);}
}
}*/
/*int main()
{
int k[1000] = {};
int n;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d", &k[i]);
}
for(int i=0; i<n; i+=2)
{
if(k[i]<k[i+1]){printf("%d ", k[i+1]);}
else if(k[i]>k[i+1]){printf("%d ", k[i]);}
}
}*/
/*int main()
{
int nm[101][101] = {};
int m,n,x,y;
scanf("%d %d %d %d",&m,&n,&x,&y);
for(int i = 0; i<n; i++)
{
for(int j = 0; j< m; j++)
{
scanf("%d ",&nm[i][j]);
}
}
int sum = 0;
int tum = 0;
for(int i = 1; i<=n-y+1; i++)
{
for(int j = 1; j<= m-x+1; j++)
{
for(int k = 0; k<y; k++)
{
for(int l = 0; l<x; l++)
{
sum += nm[i+k][j+l];
}
}
if(sum > tum)
{
tum = sum;
}
sum = 0;
}
}
printf("%d",tum);
return 0;
}*/
int main()
{
int m[22][22] = {};
int p[9][2] = {};
int n;
for(int i = 1; i <= 10; i ++)
{
for(int j = 1; j <= 10; j ++)
{
scanf("%d ",&m[i][j]);
}
}
for(int i = 1; i <= 10; i ++)
{
for(int j = 1; j <= 10; j ++)
{
if(m[i][j] > 0) //풍선이 있으면
{
int q = m[i][j];
int u = 0;
int d = 0;
int r = 0;
int l = 0;
for(int k = 1; k<= q; k++)
{
m[i][j] = -2;
if(m[i+k][j] != -1 && d == 0 && m[i+k][j]<=0)
{
m[i+k][j] = -2;
}
else if(m[i+k][j] == -1)
{
d = 1;
}
if(m[i-k][j] != -1 && u == 0 && m[i-k][j]<=0 )
{
m[i-k][j] = -2;
}
else if(m[i-k][j] == -1)
{
u = 1;
}
if(m[i][j+k] != -1 && r== 0 && m[i][j+k]<=0)
{
m[i][j+k] = -2;
}
else if(m[i][j+k] == -1)
{
r = 1;
}
if(m[i][j-k] != -1 && l == 0 && m[i][j-k]<=0)
{
m[i][j-k] = -2;
}
else if(m[i][j-k] == -1)
{
l = 1;
}
}
}
}
}
scanf("%d", &n);
for(int i=0; i<n; i++)
{
scanf("%d %d", &p[i][0], &p[i][1]);
if(m[p[i][0]][p[i][1]] == 0)
{
m[p[i][0]][p[i][1]] = i+1;
}
}
for(int i = 1; i<=10; i++)
{
for(int j=0; j<=10; j++)
{
printf("%d ", m[i][j]);
}
printf("\n");
}
printf("Character Information\n");
for(int i=0; i<n; i++, puts(""))
{
if(m[p[i][0]][p[i][1]]==i+1)
{
printf("player %d survive", i+1);
}
else
{
printf("player %d dead", i+1);
}
}
return 0;
}