import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}

class House {
    private int[][][] inhabitant;

    House() {
        inhabitant = new int[4][3][10];
    }

    void addInhabitant(int building, int floor, int room, int value) {
        inhabitant[building - 1][floor - 1][room - 1] += value;
    }

    void showInhabitant(){
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
} Main public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st; st try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } int building building floor floor room room value; value String line; line House house = new House(); house new House() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            } {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            } line = br.readLine() line br.readLine() br.readLine br st = new StringTokenizer(line) st new StringTokenizer(line) building = Integer.parseInt(st.nextToken()) building Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st floor = Integer.parseInt(st.nextToken()) floor Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st room = Integer.parseInt(st.nextToken()) room Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st value = Integer.parseInt(st.nextToken()) value Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st house.addInhabitant(building,floor,room,value) house.addInhabitant house building floor room value house.showInhabitant() house.showInhabitant house String[] args args class House {
    private int[][][] inhabitant;

    House() {
        inhabitant = new int[4][3][10];
    }

    void addInhabitant(int building, int floor, int room, int value) {
        inhabitant[building - 1][floor - 1][room - 1] += value;
    }

    void showInhabitant(){
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        }
    }
} House private int[][][] inhabitant; inhabitant House() {
        inhabitant = new int[4][3][10];
    } House {
        inhabitant = new int[4][3][10];
    } inhabitant = new int[4][3][10] inhabitant new int[4][3][10] 4 3 10 void addInhabitant(int building, int floor, int room, int value) {
        inhabitant[building - 1][floor - 1][room - 1] += value;
    } addInhabitant {
        inhabitant[building - 1][floor - 1][room - 1] += value;
    } inhabitant[building - 1][floor - 1][room - 1] += value inhabitant[building - 1][floor - 1][room - 1] inhabitant[building - 1][floor - 1] inhabitant[building - 1] inhabitant building - 1 building 1 floor - 1 floor 1 room - 1 room 1 value int building building int floor floor int room room int value value void showInhabitant(){
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        }
    } showInhabitant {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        }
    } for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        } {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        } for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            } {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    sb.append(" ").append(inhabitant[i][j][k]);
                } {
                    sb.append(" ").append(inhabitant[i][j][k]);
                } sb.append(" ").append(inhabitant[i][j][k]) sb.append(" ").append sb.append(" ") sb.append sb " " inhabitant[i][j][k] inhabitant[i][j] inhabitant[i] inhabitant i j k System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb if(i<3) {
                System.out.println("####################");
            } i<3 i 3 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
} public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        try {
            int building, floor, room, value;
            String line;
            House house = new House();
            int n = Integer.parseInt(br.readLine());
            for (int i = 0; i < n; i++) {
                line = br.readLine();
                st = new StringTokenizer(line);
                building = Integer.parseInt(st.nextToken());
                floor = Integer.parseInt(st.nextToken());
                room = Integer.parseInt(st.nextToken());
                value = Integer.parseInt(st.nextToken());
                house.addInhabitant(building,floor,room,value);
            }
            house.showInhabitant();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}

class House {
    private int[][][] inhabitant;

    House() {
        inhabitant = new int[4][3][10];
    }

    void addInhabitant(int building, int floor, int room, int value) {
        inhabitant[building - 1][floor - 1][room - 1] += value;
    }

    void showInhabitant(){
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                StringBuilder sb = new StringBuilder();
                for (int k = 0; k < 10; k++) {
                    sb.append(" ").append(inhabitant[i][j][k]);
                }
                System.out.println(sb.toString());
            }
            if(i<3) {
                System.out.println("####################");
            }
        }
    }
}