using System;



class Program
{
    static void Main(string[] args)
    {
        Input CInput = new Input();
        //EasyTask CEasyTask = new EasyTask();
        //int input = 0;
        //int[] input = new int[(int)Input.Define.MAX_ArraySize];
        //int[,] input = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
        //int num = 0;
        //input = CInput.Line1_int();
        //input = CInput.Multiline_int(' ', 2, ref num);
        int[,,] DB = new int[4, 3, 10];

        int[,] input2 = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];

        int buf = 0;
        int input1 = CInput.Line1_int();
        input2 = CInput.Multiline_int(' ', 4, ref buf, input1);

        for (int i = 0; i < input1; i++)
        {
            DB[input2[i, 0] - 1, input2[i, 1] - 1, input2[i, 2] - 1] += input2[i, 3];
        }

        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                for (int k = 0; k < 10; k++)
                {
                    System.Console.Write(" {0}", DB[i, j, k]);
                }
                System.Console.WriteLine();
            }
            if (i != 3) System.Console.WriteLine("####################");
        }





    }
}








class Input
{
    public enum Define
    {
        MAX_ArraySize = 1000000,
        ArraySize2d = 4,                // 2?¬?????????????[][?] ???????
    }

    public string Line1_string()
    {
        return Console.ReadLine();
    }

    public string[] Line1_string(int chr)
    {
        var input = Console.ReadLine();
        var split = input.Split(' ');
        return split;
    }

    public int Line1_int()
    {
        var input = Console.ReadLine();
        return int.Parse(input);
    }

    public double Line1_double()
    {
        var input = Console.ReadLine();
        return double.Parse(input);
    }

    public int[] Line1_int(int chr, int num)
    {
        var input = Console.ReadLine();
        var split = input.Split(' ');
        int[] spliti = new int[100];
        for (int i = 0; i < num; i++)
        {
            spliti[i] = int.Parse(split[i]);
        }
        return spliti;
    }

    public int[] Multiline_int(ref int datanum)
    {
        int i = 0;
        int[] data = new int[(int)Input.Define.MAX_ArraySize];
        while (true)
        {
            var input = Console.ReadLine();
            var value = int.Parse(input);
            if (value == 0) break;
            data[i] = value;
            i++;
        }
        datanum = i;
        return data;
    }
    /// <summary>
    /// ?????°??????int??????????????????????????????
    /// </summary>
    /// <param name="chr">???????????????</param>
    /// <param name="num">?????????????????????????????°</param>
    /// <param name="datanum">??????????????????????????°</param>
    /// <returns></returns>
    public int[,] Multiline_int(int chr, int num, ref int datanum, int loadnum = 0)
    {
        int i = 0;
        int[,] data = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
        while (true)
        {
            if (loadnum != 0 && loadnum == i) break;

            var input = Console.ReadLine();
            var split = input.Split(' ');
            int[] spliti = new int[100];
            for (int j = 0; j < num; j++)
            {
                spliti[j] = int.Parse(split[j]);
            }
            //if (spliti[0] == 0 && spliti[1] == 0) break;  // ???????????????????????????
            for (int j = 0; j < num; j++)
            {
                data[i, j] = spliti[j];
            }
            i++;
        }
        datanum = i;
        return data;
    }


}

class EasyTask
{
    public void Swap(ref int a, ref int b)
    {
        int buf = 0;
        buf = a;
        a = b;
        b = buf;
    }






}

Measured memory_bytes: 40696