const input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
Arr.shift();

let bfr = [];
for (let i=0; i<4; i++) {
    bfr.push([]);
    for (let j=0; j<3; j++) {
        bfr[i].push([]);
        for (let k=0; k<10; k++) {
            bfr[i][j].push(0);
        }
    }
}

for (i=0; i<Arr.length; i++) {
    let tenant = Arr[i].split(' ').map(Number);
    let b = tenant[0] - 1;
    let f = tenant[1] - 1;
    let r = tenant[2] - 1;
    let v = tenant[3];
    bfr[b][f][r] += v;
}

for (i=0; i<4; i++) {
    for(j=0; j<3; j++) {
        console.log(' ' + bfr[i][j].join(' '));
    }
    if (i !== 3) {
        console.log("####################");
    }
}

  
