function main(lines) {
    const input = lines.split('\n').slice(1)
    const init = Array(11).join(` 0`) + '\n'
    const breakLine = Array(21).join('#') + '\n'

    let output = ''
    for(let i=0; i<4; i++){
        for(let k=0; k<3; k++){
            output += init
        }
        if(i<3){
            output += breakLine
        }
    }

    let outputArray = Array.from(output).map(function(val){return val === '0' ? 0 : val;})

    for(let i=0; i<input.length; i++){
        const inputLines = input[i].split(' ').map(Number)
        const b = inputLines[0]-0
        const f = inputLines[1]-0
        const r = inputLines[2]-0
        const v = inputLines[3]-0
        const changeLine = (b-1) * (21*4) + (f-1)*(10*2+1) + (r*2-1);

        outputArray[changeLine] += v
    }
    console.log(' ' + outputArray.join('').trim())
}

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