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

void main() {
    int[][][] bld = new int[][][](4, 3, 10);
    int n = readln.chomp.to!int;
    foreach (i; 0 .. n) {
        int[] tmp = readln.chomp.split.to!(int[]);
        int b = tmp[0], f = tmp[1], r = tmp[2], v = tmp[3];
        bld[b-1][f-1][r-1] += v;
    }
    foreach (i; 0 .. 4) {
        foreach (j; 0 .. 3) {
            foreach (k; 0 .. 10) {
                write(" ", bld[i][j][k]);
            }
            writeln;
        }
        if (i != 3) "####################".writeln;
    }
}
