import std.stdio;
import std.array;
import std.conv;
import std.string;
import std.algorithm;

void main()
{
    int n = readln.strip.to!int;
    int[10][3][4] h ;
    foreach(i;0..4)
        foreach(j;0..3)
            foreach(k;0..10)
                h[i][j][k] = 0;

    foreach(i;0..n) {
        auto info = map!(to!int)(readln.strip.split);
        h[info[0]-1][info[1]-1][info[2]-1] += info[3];
    }

    foreach(i;0..4) {
        foreach(j;0..3) {
            foreach(k;0..10) {
                write(" ");
                write(h[i][j][k]);
            }
            writeln();
        }
 	if(i<3)
        writeln("####################");
    }
}