import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int datanum = sc.nextInt(); datanum sc.nextInt() sc.nextInt sc int dataroom[][][] = new int[3][10][4]; dataroom new int[3][10][4] 3 10 4 int b b f f r r v; v for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        } int i = 0; int i = 0; i 0 i < datanum i datanum i++ i++ i {
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        } {
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        } b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc dataroom[f-1][r-1][b-1] += v dataroom[f-1][r-1][b-1] dataroom[f-1][r-1] dataroom[f-1] dataroom f-1 f 1 r-1 r 1 b-1 b 1 v for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                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 m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        } {
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        } for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            } int m = 0; int m = 0; m 0 m < 3 m 3 m++ m++ m {
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            } {
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            } for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                } int n = 0; int n = 0; n 0 n < 10 n 10 n++ n++ n {
                    System.out.print(" " + dataroom[m][n][i]);
                } {
                    System.out.print(" " + dataroom[m][n][i]);
                } System.out.print(" " + dataroom[m][n][i]) System.out.print System.out System System.out " " + dataroom[m][n][i] " " dataroom[m][n][i] dataroom[m][n] dataroom[m] dataroom m n i 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) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    }
} public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    }
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int datanum = sc.nextInt();
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;

        for(int i = 0; i < datanum; i++){
            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();
            dataroom[f-1][r-1][b-1] += v;
        }

        for(int i = 0; i < 4; i++ ){
            for(int m = 0; m < 3; m++ ){
                for(int n = 0; n < 10; n++){
                    System.out.print(" " + dataroom[m][n][i]);
                }
                System.out.println();
            }
            if( i != 3 ) System.out.println("####################");
        }
    }
}
