paper = Array.new(16,0)
0.upto(15) {|x| paper[x] = Array.new(16,0) }
while gets
  data = $_.chomp.split(',').map {|x| x.to_i}
  x,y,size = data[0], data[1], data[2]
  case size
  when 1
    (x+2).upto(x+4) {|i| paper[i][y+3] += 1}
    paper[x+3][y+2] += 1; paper[x+3][y+4] += 1
  when 2
    (x+2).upto(x+4) {|j| (y+2).upto(y+4) {|k| paper[j][k] += 1}}
  when 3
    (x+2).upto(x+4) {|j| (y+2).upto(y+4) {|k| paper[j][k] += 1}}
    paper[x+1][y+3] += 1
    paper[x+5][y+3] += 1
    paper[x+3][y+1] += 1
    paper[x+3][y+5] += 1
  end  
end
3.upto(12) {|p| (3.upto(12) {|q| print paper[p][q]; print ' '}); puts ""}

max = paper.flatten.max
tile_num = 0
3.upto(12) {|p| 3.upto(12) {|q| tile_num += 1 if paper[p][q] == 0}}

puts tile_num,max