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

void main() {
	readln;
	auto d = new int[][][](4,3,10);
	foreach (string l; lines(stdin)) {
		auto r = l.chomp.split.to!(int[]);
		d[r[0]-1][r[1]-1][r[2]-1] += r[3];
	}
	foreach (j; 0..4) {
		foreach (i; d[j]) {
			" %s".writefln(i.to!(string[]).join(" "));
		}
		if (j != 3) "#".repeat(20).join.writeln;
	}
}