import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int a[][][] = new int[4][3][10]; a new int[4][3][10] 4 3 10 String str[]; str int b b f f r r v; v while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[b-1][f-1][r-1] + v;
        } n-->0 n-- n 0 {
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[b-1][f-1][r-1] + v;
        } str = br.readLine().split(" ") str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b = Integer.parseInt(str[0]) b Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 f = Integer.parseInt(str[1]) f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 r = Integer.parseInt(str[2]) r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 v = Integer.parseInt(str[3]) v Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 a[b-1][f-1][r-1] = a[b-1][f-1][r-1] + v a[b-1][f-1][r-1] a[b-1][f-1] a[b-1] a b-1 b 1 f-1 f 1 r-1 r 1 a[b-1][f-1][r-1] + v a[b-1][f-1][r-1] a[b-1][f-1] a[b-1] a 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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        } 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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        } {
            for(int j=0;j<3;j++){
                for(int k=0;k<10;k++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        } for(int j=0;j<3;j++){
                for(int k=0;k<10;k++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                for(int k=0;k<10;k++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            } {
                for(int k=0;k<10;k++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            } for(int k=0;k<10;k++){
                    System.out.print(" "+a[i][j][k]);
                } int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
                    System.out.print(" "+a[i][j][k]);
                } {
                    System.out.print(" "+a[i][j][k]);
                } System.out.print(" "+a[i][j][k]) System.out.print System.out System System.out " "+a[i][j][k] " " a[i][j][k] a[i][j] a[i] a 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 "####################" String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a[][][] = new int[4][3][10]; 
        String str[];
        int b,f,r,v;
        while(n-->0){
            str = br.readLine().split(" ");
            b = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);
            v = Integer.parseInt(str[3]);
            a[b-1][f-1][r-1] = a[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++){
                    System.out.print(" "+a[i][j][k]);
                }
                System.out.println();
            }
            if(i!=3) System.out.println("####################");
        }
    }
}