#include <stdio.h>

#define SIZE 10

int main()
{
	int paper[SIZE][SIZE], x, y, s, i, j, zero_count, max;

	zero_count = 0;
	max = 0;

	for(i = 0; i < SIZE; i++){
		for(j = 0; j < SIZE; j++){
			paper[i][j] = 0;
		}
	}

	while(scanf("%d,%d,%d", &x, &y, &s) != EOF){
		switch(s){
			case 1:
				paper[x][y]++;
				paper[x-1][y]++;
				paper[x][y-1]++;
				paper[x+1][y]++;
				paper[x][y+1]++;
				break;
			case 2:
				for(i = 0; i < 3; i++){
					for(j = 0; j < 3; j++){
						paper[x+i-1][y+j-1]++;
					}
				}
				break;
			case 3:
				for(i = 0; i < 3; i++){
					for(j = 0; j < 3; j++){
						paper[x+i-1][y+j-1]++;
					}
				}

				paper[x-2][y]++;
				paper[x][y-2]++;
				paper[x+2][y]++;
				paper[x][y+2]++;
				break;
		}
	}

	for(i = 0; i < SIZE; i++){
		for(j = 0; j < SIZE; j++){
			printf("%2d", paper[j][i]);
			if(paper[j][i] == 0) zero_count++;
			if(paper[j][i] > max) max = paper[j][i];
		}
		printf("\n");
	}

	printf("%d\n%d\n", zero_count, max);

	return 0;
}