import java.util.Scanner;                                                                        
class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count[][][] = new int[4][3][10];
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        }
        for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        }
    }
}               import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count[][][] = new int[4][3][10];
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        }
        for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        }
    }
} Main public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count[][][] = new int[4][3][10];
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        }
        for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        }
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count[][][] = new int[4][3][10];
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        }
        for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int count[][][] = new int[4][3][10]; count new int[4][3][10] 4 3 10 for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        } int i = 0; int i = 0; i 0 i <= 3 i 3 i++ i++ i {
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        } {
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        } for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            } int j = 0; int j = 0; j 0 j <= 2 j 2 j++ j++ j {
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            } {
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            } for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                } int e = 0; int e = 0; e 0 e <= 9 e 9 e++ e++ e {
                    count[i][j][e] = 0;
                } {
                    count[i][j][e] = 0;
                } count[i][j][e] = 0 count[i][j][e] count[i][j] count[i] count i j e 0 for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        } int i =1; int i =1; i 1 i <= n i n i++ i++ i {
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        } {
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        } int b = in.nextInt(); b in.nextInt() in.nextInt in int f = in.nextInt(); f in.nextInt() in.nextInt in int r = in.nextInt(); r in.nextInt() in.nextInt in int v = in.nextInt(); v in.nextInt() in.nextInt in count[b-1][f-1][r-1] += v count[b-1][f-1][r-1] count[b-1][f-1] count[b-1] count b-1 b 1 f-1 f 1 r-1 r 1 v for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        } int i = 0; int i = 0; i 0 i <= 3 i 3 i++ i++ i {
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        } {
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        } for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            } int j = 0; int j = 0; j 0 j <= 2 j 2 j++ j++ j {
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            } {
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            } for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                } int e = 0; int e = 0; e 0 e <= 9 e 9 e++ e++ e {
                    System.out.print(" " + count[i][j][e]);
                } {
                    System.out.print(" " + count[i][j][e]);
                } System.out.print(" " + count[i][j][e]) System.out.print System.out System System.out " " + count[i][j][e] " " count[i][j][e] count[i][j] count[i] count i j e 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.println System.out System System.out "####################" String[] args args
import java.util.Scanner;                                                                        
class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count[][][] = new int[4][3][10];
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                for(int e = 0; e <= 9; e++){
                    count[i][j][e] = 0;
                }
            }
        }
        for(int i =1; i <= n; i++){
        int b = in.nextInt();
        int f = in.nextInt();
        int r = in.nextInt();
        int v = in.nextInt();
        count[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i <= 3; i++){
            for(int j = 0; j <= 2; j++){
                   for(int e = 0; e <= 9; e++){
                    System.out.print(" " + count[i][j][e]);
                }
                System.out.println();
            }
            if(i != 3){
            System.out.println("####################");
            }
        }
    }
}              