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

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[][][] number = new int[4][3][10];

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        }

        while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io 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[][][] number = new int[4][3][10];

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        }

        while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 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[][][] number = new int[4][3][10];

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        }

        while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[][][] number = new int[4][3][10];

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        }

        while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 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[][][] number = new int[4][3][10]; number new int[4][3][10] 4 3 10 for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        } {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        } for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            } {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            } for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    number[b][f][r] = 0;
                } {
                    number[b][f][r] = 0;
                } number[b][f][r] = 0 number[b][f][r] number[b][f] number[b] number b f r 0 while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        } n != 0 n 0 {
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        } String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(str[0]) - 1; b Integer.parseInt(str[0]) - 1 Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 1 int f = Integer.parseInt(str[1]) - 1; f Integer.parseInt(str[1]) - 1 Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 1 int r = Integer.parseInt(str[2]) - 1; r Integer.parseInt(str[2]) - 1 Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 1 int v = Integer.parseInt(str[3]); v Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 number[b][f][r] += v number[b][f][r] number[b][f] number[b] number b f r v n-- n for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        } {
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        } for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            } {
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            } for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(" "+number[b][f][r]);
                } {
                    System.out.print(" "+number[b][f][r]);
                } System.out.print(" "+number[b][f][r]) System.out.print System.out System System.out " "+number[b][f][r] " " number[b][f][r] number[b][f] number[b] number b f r System.out.println("") System.out.println System.out System System.out "" if(b != 3) System.out.println("####################"); b != 3 b 3 System.out.println("####################") System.out.println System.out System System.out "####################" String args[] args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

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[][][] number = new int[4][3][10];

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3;f++) {
                for(int r = 0; r < 10;r++) {
                    number[b][f][r] = 0;
                }
            }
        }

        while(n != 0){
            String str[] = br.readLine().split(" ");
            int b = Integer.parseInt(str[0]) - 1;
            int f = Integer.parseInt(str[1]) - 1;
            int r = Integer.parseInt(str[2]) - 1;
            int v = Integer.parseInt(str[3]);

            number[b][f][r] += v;
            n--;
        }
        for(int b = 0; b < 4; b++){
            for(int f = 0; f < 3; f++){
                for(int r = 0; r < 10; r++){
                    System.out.print(" "+number[b][f][r]);
                }
                System.out.println("");
            }
            if(b != 3) System.out.println("####################");
        }
    }
}