'use strict'

const main = arg => {
    const input = arg.trim().split("\n");
    const num = parseInt(input[0], 10);
    const info = input.slice(1).slice(0, num);
    
    const builds = [...Array(4)].map((a, l) => {
        return (
            [...Array(3)].map((b, m) => {
                return [...Array(10)].map((c, n) => (0));
            })
        )
    });

    //b, f, r, v
    info.forEach(inout => {
        const data = inout.split(" ").map(num => parseInt(num, 10));

        const b = data[0]-1;
        const f = data[1]-1;
        const r = data[2]-1;
        const v = data[3];

        builds[b][f][r] += v;
    });

    const result = builds.map((a, l) => {
        return builds[l].map((b, m) => {
            return " " + builds[l][m].join(" ");
        }).join("\n");
    });
    
    console.log(result.join("\n####################\n"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
