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

void main()
{
    int[11][4][5] bewur;
    int n = 0;
    readf("%d\n", &n);
    auto a = new Tuple!(int, "b", int, "f", int, "r", int, "v")[n];
    for (int i = 0; i < n; i++)
    {
        readf("%d %d %d %d\n", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
        bewur[a[i].b][a[i].f][a[i].r] += a[i].v;
    }
    for (int b = 1; b <= 4; b++)
    {
    for (int f = 1; f <= 3; f++)
    {
    for (int r = 1; r <= 10; r++)
    {
    write(" ",bewur[b][f][r]);
    }writeln();
    }
    if (b != 4)writeln("####################");
    }
}

