#include <iostream>
#include <algorithm>
using namespace std;

int table[12][12]={0};

void dropink(int x,int y, int s){
	switch (s){
		case 3:
			if(x-2>=0)
				table[x-2][y]++;
			if(y-2>=0)
				table[x][y-2]++;
			if(x+2<=11)
				table[x+2][y]++;
			if(y+2<=11)
				table[x][y+2]++;
		case 2:
			table[x+1][y+1]++;
			table[x-1][y+1]++;
			table[x+1][y-1]++;
			table[x-1][y-1]++;
		case 1:
			table[x][y]++;
			table[x+1][y]++;
			table[x][y+1]++;
			table[x-1][y]++;
			table[x][y-1]++;
	}
	return ;
}

int main(){
	int x,y,s;
	char tem;
	while( cin >> x >> tem >> y >> tem >> s ,!cin.eof())
		dropink(x+1,y+1,s);
	int NUM=0,MAX=0;
	for(int y=1;y<=10;y++){
		for(int x=1;x<=10;x++){
			cout << table[x][y] << ' ';
			if(table[x][y])
				MAX=max(MAX,table[x][y]);
			else
				NUM++;
		}
		cout << endl;
	}
	cout << NUM << endl << MAX << endl;
	return 0;
}