public class Main {
    public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    }
} public class Main {
    public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    }
} Main public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    } main {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    } int[][][] info = new int[4][3][10]; info 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 ++) { info[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 ++) { info[i][j][k] = 0; }
            }
        } {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        } for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[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 ++) { info[i][j][k] = 0; }
            } {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            } for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; } int k = 0; int k = 0; k 0 k < 10 k 10 k ++ k ++ k { info[i][j][k] = 0; } { info[i][j][k] = 0; } info[i][j][k] = 0 info[i][j][k] info[i][j] info[i] info i j k 0 java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int built = 0; built 0 int floor = 0; floor 0 int room = 0; room 0 int num = 0; num 0 for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        } int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        } {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        } built = sc.nextInt() built sc.nextInt() sc.nextInt sc floor = sc.nextInt() floor sc.nextInt() sc.nextInt sc room = sc.nextInt() room sc.nextInt() sc.nextInt sc num = sc.nextInt() num sc.nextInt() sc.nextInt sc info[built - 1][floor - 1][room - 1] += num info[built - 1][floor - 1][room - 1] info[built - 1][floor - 1] info[built - 1] info built - 1 built 1 floor - 1 floor 1 room - 1 room 1 num for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        } 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 ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        } {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        } for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            } int j = 0; int j = 0; j 0 j < 3 j 3 j ++ j ++ j {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            } {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            } for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k ++ k ++ k {
                    System.out.print(" " + info[i][j][k]);
                } {
                    System.out.print(" " + info[i][j][k]);
                } System.out.print(" " + info[i][j][k]) System.out.print System.out System System.out " " + info[i][j][k] " " info[i][j][k] info[i][j] info[i] info i j k System.out.print("\n") System.out.print System.out System System.out "\n" if (i != 4 - 1) { System.out.print("####################\n"); } i != 4 - 1 i 4 - 1 4 1 { System.out.print("####################\n"); } System.out.print("####################\n") System.out.print System.out System System.out "####################\n" String[] args args public class Main {
    public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    }
} public class Main {
    public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    }
} Main
public class Main {
    public static void main(String[] args) {

        // ?£?, ???, ??¨?±??????????????´???¨???????????????????????????.
        // ????????????????????????.
        int[][][] info = new int[4][3][10];
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) { info[i][j][k] = 0; }
            }
        }

        // ?????±???????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int built = 0;
        int floor = 0;
        int room = 0;
        int num = 0;
        for (int i = 0; i < n; i ++) {
            built = sc.nextInt();
            floor = sc.nextInt();
            room = sc.nextInt();
            num = sc.nextInt();
            info[built - 1][floor - 1][room - 1] += num;
        }

        // ?????±????????????????§?????????¨?????????.
        for (int i = 0; i < 4; i ++) {
            for (int j = 0; j < 3; j ++) {
                for (int k = 0; k < 10; k ++) {
                    System.out.print(" " + info[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 4 - 1) { System.out.print("####################\n"); }
        }
    }
}