import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i,j,k,m;
        int [][][] cnt = new int[4][3][10];
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        m = Integer.parseInt(in.readLine());
        for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        }
        for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        }
        System.out.flush();
    }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main{
    public static void main(String[] args) throws IOException {
        int i,j,k,m;
        int [][][] cnt = new int[4][3][10];
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        m = Integer.parseInt(in.readLine());
        for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        }
        for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        }
        System.out.flush();
    }
} Main public static void main(String[] args) throws IOException {
        int i,j,k,m;
        int [][][] cnt = new int[4][3][10];
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        m = Integer.parseInt(in.readLine());
        for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        }
        for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        }
        System.out.flush();
    } main {
        int i,j,k,m;
        int [][][] cnt = new int[4][3][10];
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        m = Integer.parseInt(in.readLine());
        for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        }
        for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        }
        System.out.flush();
    } int i i j j k k m; m int [][][] cnt = new int[4][3][10]; cnt new int[4][3][10] 4 3 10 int[] n = new int[990]; n new int[990] 990 String[] str = new String[990]; str new String[990] 990 BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) m = Integer.parseInt(in.readLine()) m Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        } i=0; i=0 i 0 i<m i m i++ i++ i {
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        } {
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        } str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            } j=0; j=0 j 0 j<4 j 4 j++ j++ j {
                n[j] = Integer.parseInt(str[j]);
            } {
                n[j] = Integer.parseInt(str[j]);
            } n[j] = Integer.parseInt(str[j]) n[j] n j Integer.parseInt(str[j]) Integer.parseInt Integer str[j] str j cnt[n[0]-1][n[1]-1][n[2]-1] += n[3] cnt[n[0]-1][n[1]-1][n[2]-1] cnt[n[0]-1][n[1]-1] cnt[n[0]-1] cnt n[0]-1 n[0] n 0 1 n[1]-1 n[1] n 1 1 n[2]-1 n[2] n 2 1 n[3] n 3 for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        } i=0; i=0 i 0 i<4 i 4 i++ i++ i {
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        } {
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        } for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            } j=0; j=0 j 0 j<3 j 3 j++ j++ j {
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            } {
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            } for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                } k=0; k=0 k 0 k<10 k 10 k++ k++ k {
                    System.out.print(" "+cnt[i][j][k]);
                } {
                    System.out.print(" "+cnt[i][j][k]);
                } System.out.print(" "+cnt[i][j][k]) System.out.print System.out System System.out " "+cnt[i][j][k] " " cnt[i][j][k] cnt[i][j] cnt[i] cnt i j k System.out.println() System.out.println System.out System System.out if(i<3) System.out.println("####################"); i<3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" System.out.flush() System.out.flush System.out System System.out String[] args args
import java.io.*;
import java.util.Arrays;
class Main{
    public static void main(String[] args) throws IOException {
        int i,j,k,m;
        int [][][] cnt = new int[4][3][10];
        int[] n = new int[990];
        String[] str = new String[990];
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        m = Integer.parseInt(in.readLine());
        for(i=0;i<m;i++){
            str = in.readLine().split(" ");
            for(j=0;j<4;j++){
                n[j] = Integer.parseInt(str[j]);
            }
            cnt[n[0]-1][n[1]-1][n[2]-1] += n[3];
        }
        for(i=0;i<4;i++){
            for(j=0;j<3;j++){
                for(k=0;k<10;k++){
                    System.out.print(" "+cnt[i][j][k]);
                }
                System.out.println();
            }
            if(i<3) System.out.println("####################");
        }
        System.out.flush();
    }
}