import java.io.*;
import java.util.Arrays;

class Main
{
    public static void main (String[ ] args) throws Exception
    {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] room = new int[4][3][10];
        
        int n = Integer.parseInt(br.readLine());

        for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        }
        
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        }
        System.out.print(sb);
    }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main
{
    public static void main (String[ ] args) throws Exception
    {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] room = new int[4][3][10];
        
        int n = Integer.parseInt(br.readLine());

        for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        }
        
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        }
        System.out.print(sb);
    }
} Main public static void main (String[ ] args) throws Exception
    {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] room = new int[4][3][10];
        
        int n = Integer.parseInt(br.readLine());

        for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        }
        
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        }
        System.out.print(sb);
    } main {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] room = new int[4][3][10];
        
        int n = Integer.parseInt(br.readLine());

        for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        }
        
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        }
        System.out.print(sb);
    } BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); br new BufferedReader (new InputStreamReader (System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        } {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        } String[] strArr = (br.readLine()).split(" "); strArr (br.readLine()).split(" ") (br.readLine()).split (br.readLine()) br.readLine br " " int b = Integer.parseInt(strArr[0]); b Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 int f = Integer.parseInt(strArr[1]); f Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 int r = Integer.parseInt(strArr[2]); r Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 int v = Integer.parseInt(strArr[3]); v Integer.parseInt(strArr[3]) Integer.parseInt Integer strArr[3] strArr 3 room[b-1][f-1][r-1] += v room[b-1][f-1][r-1] room[b-1][f-1] room[b-1] room b-1 b 1 f-1 f 1 r-1 r 1 v for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        } {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        } for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            } {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            } for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    sb.append(" ").append(room[i][j][k]);
                } {
                    sb.append(" ").append(room[i][j][k]);
                } sb.append(" ").append(room[i][j][k]) sb.append(" ").append sb.append(" ") sb.append sb " " room[i][j][k] room[i][j] room[i] room i j k sb.append("\n") sb.append sb "\n" if(i != 3)
            {
                sb.append("####################\n");
            } i != 3 i 3 {
                sb.append("####################\n");
            } sb.append("####################\n") sb.append sb "####################\n" System.out.print(sb) System.out.print System.out System System.out sb String[ ] args args
import java.io.*;
import java.util.Arrays;

class Main
{
    public static void main (String[ ] args) throws Exception
    {
        BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
        StringBuilder sb = new StringBuilder();
        int[][][] room = new int[4][3][10];
        
        int n = Integer.parseInt(br.readLine());

        for(int i = 0; i < n; i++)
        {
            String[] strArr = (br.readLine()).split(" ");
            int b = Integer.parseInt(strArr[0]);
            int f = Integer.parseInt(strArr[1]);
            int r = Integer.parseInt(strArr[2]);
            int v = Integer.parseInt(strArr[3]);
            
            room[b-1][f-1][r-1] += v;
        }
        
        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 3; j++)
            {
                for(int k = 0; k < 10; k++)
                {
                    sb.append(" ").append(room[i][j][k]);
                }
                sb.append("\n");
            }
            if(i != 3)
            {
                sb.append("####################\n");
            }
        }
        System.out.print(sb);
    }
}