'use strict';
(function(stdin) {
  var lines  = stdin.toString().split('\n');
  var result = (function(data) {
    var result = [];
    var apartment = buildArray();
    data.map(function(v){
      var info = v.split(' ');
      apartment[info[0] - 1][info[1] - 1][info[2] - 1] += parseInt(info[3]);
    });

    apartment.forEach(function(apart){
      apart.forEach(function(room){
        result.push(' ' + room.join(' '))
      });
      result.push('####################');
    });
    result.pop();
    return result.join('\n');

    function buildArray() {
      var all = [];
      for (var i = 0; i < 4; i++) {
        var apart = [];
        for (var j = 0; j < 3; j++){
          var room = [];
          for (var k = 0; k < 10; k++)
            room.push(0);
          apart.push(room)
        }
        all.push(apart);
      }
      return all;
    }

  }(lines.slice(0,lines.shift())
    ));

  if(result.length !== 0) console.log(result);

}(require('fs').readFileSync('/dev/stdin', 'utf8')));