import java.util.Scanner;

public class Main {

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

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine()); datanum Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine 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 String buf[]; buf for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            dataroom[f-1][r-1][b-1] += v;
        } int i = 0; int i = 0; i 0 i < datanum i datanum i++ i++ i {
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            dataroom[f-1][r-1][b-1] += v;
        } {
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            dataroom[f-1][r-1][b-1] += v;
        } buf = sc.nextLine().split(" ") buf sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " b = Integer.parseInt(buf[0]) b Integer.parseInt(buf[0]) Integer.parseInt Integer buf[0] buf 0 f = Integer.parseInt(buf[1]) f Integer.parseInt(buf[1]) Integer.parseInt Integer buf[1] buf 1 r = Integer.parseInt(buf[2]) r Integer.parseInt(buf[2]) Integer.parseInt Integer buf[2] buf 2 v = Integer.parseInt(buf[3]) v Integer.parseInt(buf[3]) Integer.parseInt Integer buf[3] buf 3 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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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 = Integer.parseInt(sc.nextLine());
        int dataroom[][][] = new int[3][10][4];
        int b,f,r,v;
        String buf[];

        for(int i = 0; i < datanum; i++){
            buf = sc.nextLine().split(" ");
            b = Integer.parseInt(buf[0]);
            f = Integer.parseInt(buf[1]);
            r = Integer.parseInt(buf[2]);
            v = Integer.parseInt(buf[3]);
            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("####################");
        }
    }
}