function main(input){
    let field = new Array(4);
    for(let i=0;i<4;i++){
        field[i] = [new Array(10).fill(0),new Array(10).fill(0),new Array(10).fill(0)];
    }

    let lines = input.split("\n");
    let length = parseInt(lines.shift());
    for(let i=0;i<length;i++){
        let args = lines[i].split(" ");
        args = allParseInt(args);
        field[args[0]-1][args[1]-1][args[2]-1]+=args[3];
    }
    
    render(field);

    
}

function allParseInt(arr){
    return arr.map(x=>parseInt(x));
}

function render(field){
    for(let i=0;i<4;i++){
        for(let j=0;j<3;j++){
            let put = "";
            for(let k=0;k<10;k++){
                put+= " "+field[i][j][k];
            }
            console.log(put);
        }
        if(i!==3){
              console.log("####################");
        }
    }
}


main(require("fs").readFileSync("/dev/stdin","utf-8"));
