function main(input) {
  var temp = input.split('\n');
  var house = [];
  var bar = "";
  for (var l =0; l < 20; l++) {
    bar += "#";
  }
  for (var j =0; j < 12; j++) {
    house[j] = Array(10).fill(0);
  }
  
  for (var i = 0; i < temp[0]; i++) {
    var arr = temp[(i+1)].split(' ').map(Number);
    var b = arr[0];
    var f = arr[1];
    var r = arr[2];
    var v = arr[3];

    house[((b-1)*3)+f-1][(r-1)] += v;
  }
  for (var k = 0; k < house.length; k++) {
    console.log(" "+house[k].join(' '));
    if((k+1)%3 == 0 && k != 0 && k != house.length-1) {
      console.log(bar);
    }
  }
}

var x = require('fs').readFileSync('/dev/stdin', 'utf-8');
main(x);
