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

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    }
} Main public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    } main {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        } {
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        } for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            } {
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            } for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    house[i][j][k] = 0;
                } {
                    house[i][j][k] = 0;
                } house[i][j][k] = 0 house[i][j][k] house[i][j] house[i] house i j k 0 int n = Integer.parseInt(input); n Integer.parseInt(input) Integer.parseInt Integer input for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        } {
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        } input = br.readLine() input br.readLine() br.readLine br String[] strArray = input.split(" "); strArray input.split(" ") input.split input " " int building = Integer.parseInt(strArray[0]) -1; building Integer.parseInt(strArray[0]) -1 Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 1 int floor = Integer.parseInt(strArray[1]) -1; floor Integer.parseInt(strArray[1]) -1 Integer.parseInt(strArray[1]) Integer.parseInt Integer strArray[1] strArray 1 1 int room = Integer.parseInt(strArray[2]) -1; room Integer.parseInt(strArray[2]) -1 Integer.parseInt(strArray[2]) Integer.parseInt Integer strArray[2] strArray 2 1 int resident = Integer.parseInt(strArray[3]); resident Integer.parseInt(strArray[3]) Integer.parseInt Integer strArray[3] strArray 3 house[building][floor][room] += resident house[building][floor][room] house[building][floor] house[building] house building floor room resident for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        } {
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        } if(i != 0){
                System.out.println("####################");
            } i != 0 i 0 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                } int l = 0; int l = 0; l 0 l < 3 l 3 l++ l++ l {
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                } {
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                } for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    } {
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(house[i][l][k]) System.out.print System.out System System.out house[i][l][k] house[i][l] house[i] house i l k System.out.println() System.out.println System.out System System.out String[] args args public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    }
} public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int[][][] house = new int[4][3][10];

//      ???????????¨????????¨?±?????????°???0
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 3; j++){
                for(int k = 0; k < 10; k++){
                    house[i][j][k] = 0;
                }
            }
        }

//      ????????????????????±?????°n
        int n = Integer.parseInt(input);

        for(int i = 0 ; i < n; i++){
            input = br.readLine();
            String[] strArray = input.split(" ");

            int building = Integer.parseInt(strArray[0]) -1;    //?£?
            int floor = Integer.parseInt(strArray[1]) -1;       //???
            int room = Integer.parseInt(strArray[2]) -1;        //?????????
            int resident = Integer.parseInt(strArray[3]);      //?????°

            house[building][floor][room] += resident;
        }

//      ??????
        for(int i = 0; i < 4; i++){
//          ?£??????????
            if(i != 0){
                System.out.println("####################");
            }
                for(int l = 0; l < 3; l++){
                    for(int k = 0; k < 10; k++){
                        System.out.print(" ");
                        System.out.print(house[i][l][k]);
                    }
                    System.out.println();
                }
        }
    }
}