import java.io.PrintWriter;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        final int[][][] house = new int[4][3][10];
        final int n = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        }
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        final int[][][] house = new int[4][3][10];
        final int n = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        }
        out.flush();
    }
} Main private static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) private static final PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] Args){
        final int[][][] house = new int[4][3][10];
        final int n = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        }
        out.flush();
    } main {
        final int[][][] house = new int[4][3][10];
        final int n = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        }
        out.flush();
    } final int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 final int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        } {
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        } final int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int f = Integer.parseInt(sc.next()); f Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int r = Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc final int v = Integer.parseInt(sc.next()); v Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc house[b-1][f-1][r-1] += v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 1 v for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        } int i = 0; int i = 0; i 0 i<4 i 4 i++ i++ i {
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        } {
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        } if(i!=0) out.println("####################"); i!=0 i 0 out.println("####################") out.println out "####################" for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            } int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            } {
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            } for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                } int k = 0; int k = 0; k 0 k<10 k 10 k++ k++ k {
                    out.print(' ');
                    out.print(house[i][j][k]);
                } {
                    out.print(' ');
                    out.print(house[i][j][k]);
                } out.print(' ') out.print out ' ' out.print(house[i][j][k]) out.print out house[i][j][k] house[i][j] house[i] house i j k out.println() out.println out out.flush() out.flush out String[] Args Args
import java.io.PrintWriter;
import java.util.Scanner;

class Main{
    private static final Scanner sc = new Scanner(System.in);
    private static final PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] Args){
        final int[][][] house = new int[4][3][10];
        final int n = Integer.parseInt(sc.next());
        for(int i = 0; i<n; i++){
            final int b = Integer.parseInt(sc.next());
            final int f = Integer.parseInt(sc.next());
            final int r = Integer.parseInt(sc.next());
            final int v = Integer.parseInt(sc.next());
            house[b-1][f-1][r-1] += v;
        }
        for(int i = 0; i<4; i++){
            if(i!=0) out.println("####################");
            for(int j = 0; j<3; j++){
                for(int k = 0; k<10; k++){
                    out.print(' ');
                    out.print(house[i][j][k]);
                }
                out.println();
            }
        }
        out.flush();
    }
}