var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( '\n' );
  var oh = new Array(4);
  for( var i=0; i<4; i++ ) {
    oh[i] = new Array(3);
    for( var j=0; j<3; j++ ) {
      oh[i][j] = new Array(10);
      for( var k=0; k<10; k++ ) {
        oh[i][j][k] = 0;
      }
    }
  }
  for( var i=1; i<data.length; i++ ) {
    var p = data[i].split( ' ' ).map( Number );
    var b = p[0]-1;
    var f = p[1]-1;
    var r = p[2]-1;
    oh[b][f][r] += p[3];
  }
  var output = [];
  for( var i=0; i<4; i++ ) {
    for( var j=0; j<3; j++ ) {
      for( var k=0; k<10; k++ ) {
        output.push( ' '+oh[i][j][k] );
      }
      output.push( '\n' );
    }
    if( i != 3 ) { output.push( '####################\n' ); }
  }
  console.log( output.join( '' ) );
});