#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
void small_size(void);
void middle_size(void);
void big_size(void);
void solve(void);

int x,y,size;
int paper[14][14]={0};

int main(){

  while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
    switch(size){
    case 1:
      small_size();
      break;
    case 2:
      small_size();
      middle_size();
      break;
    case 3:
      small_size();
      middle_size();
      big_size();
      break;
    }

  }

  solve();

  return 0;
}

void small_size(){

  paper[y+2][x+2]++;
  paper[y+1][x+2]++;
  paper[y+2][x+1]++;
  paper[y+2][x+3]++;
  paper[y+3][x+2]++;

}
void middle_size(){

  paper[y+1][x+1]++;
  paper[y+3][x+1]++;
  paper[y+1][x+3]++;
  paper[y+3][x+3]++;

}

void big_size(){

  paper[y+2][x]++;
  paper[y][x+2]++;
  paper[y+2][x+4]++;
  paper[y+4][x+2]++;

}

void solve(){

  int i,j;
  int zero_cnt=0;
  int max=0;

  for(i=2;i<12;i++){
    for(j=2;j<12;j++){

      if(paper[i][j]==0){
	zero_cnt++;
      }

      if(max<paper[i][j]){
	max=paper[i][j];
      }
    }
  }

  for(i=2;i<12;i++){
    for(j=2;j<12;j++){
      printf("%d ",paper[i][j]);
    }
    printf("\n");
  }

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

}