Problem:
Official House

You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.

For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.

Assume that initially no person lives in the building.

Input

In the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.

Output

For each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print "####################" (20 '#') between buildings.

Constraints

No incorrect building, floor and room numbers are given.

0 ≤ the number of tenants during the management ≤ 9

Sample Input

3
1 1 3 8
3 2 2 7
4 3 8 1

Sample Output

0 0 8 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
####################
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
####################
0 0 0 0 0 0 0 0 0 0
0 7 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
####################
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0

Solution in C# (judge verdict: Accepted)

using System;
using System.Runtime.CompilerServices;

namespace rensyuu1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            int[] b = new int[num];
            int[] f = new int[num];
            int[] r = new int[num];
            int[] v = new int[num];
            //箱の用意
            int[,,] kanri = new int[4, 3, 10];
            for (int k1 = 0; k1 < 4; k1++)
            {
                for (int k2 = 0; k2 < 3; k2++)
                {
                    for (int k3 = 0; k3 < 10; k3++)
                        kanri[k1, k2, k3] = 0;
                }
            }
            //読み取り
            for (int i1 = 0; i1 < num; i1++)
            {
                string[] line = Console.ReadLine().Split(new char[] { ' ' });
                b[i1] = int.Parse(line[0]) - 1;
                f[i1] = int.Parse(line[1]) - 1;
                r[i1] = int.Parse(line[2]) - 1;
                v[i1] = int.Parse(line[3]);
                kanri[b[i1], f[i1], r[i1]] = kanri[b[i1], f[i1], r[i1]] + v[i1];
            }
            //出力
            for (int o3 = 0; o3 < 4; o3++)
            {
                for (int o1 = 0; o1 < 3; o1++)
                {
                    for (int o2 = 0; o2 < 10; o2++)
                    {
                        Console.Write($" {kanri[o3, o1, o2]}");
                    }
                    Console.WriteLine();
                }
                if (o3 < 3)
                {
                    Console.WriteLine("####################");
                }
            }


        }
    }
}