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));
        int n = Integer.parseInt(br.readLine());
        int[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                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));
        int n = Integer.parseInt(br.readLine());
        int[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 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[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 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[][][] list = new int[4][3][10]; list new int[4][3][10] 4 3 10 for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        } {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        } String[] lines = br.readLine().split(" "); lines br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] nList = new int[4]; nList new int[4] 4 for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            } int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            } {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            } nList[j] = Integer.parseInt(lines[j]) - 1 nList[j] nList j Integer.parseInt(lines[j]) - 1 Integer.parseInt(lines[j]) Integer.parseInt Integer lines[j] lines j 1 list[nList[0]][nList[1]][nList[2]] += nList[3] + 1 list[nList[0]][nList[1]][nList[2]] list[nList[0]][nList[1]] list[nList[0]] list nList[0] nList 0 nList[1] nList 1 nList[2] nList 2 nList[3] + 1 nList[3] nList 3 1 for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        } int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        } {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        } for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            } int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            } {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            } for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                } int l = 0; int l = 0; l 0 l < 10 l 10 l++ l++ l {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                } {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                } if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    } 0 != list[j][k][l] 0 list[j][k][l] list[j][k] list[j] list j k l {
                        System.out.print(" " + list[j][k][l]);
                    } System.out.print(" " + list[j][k][l]) System.out.print System.out System System.out " " + list[j][k][l] " " list[j][k][l] list[j][k] list[j] list j k l {
                        System.out.print(" 0");
                    } System.out.print(" 0") System.out.print System.out System System.out " 0" System.out.println() System.out.println System.out System System.out if (j != 3) {
                System.out.println("####################");
            } j != 3 j 3 {
                System.out.println("####################");
            } 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));
        int n = Integer.parseInt(br.readLine());
        int[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        }
    }
} public 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[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                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));
        int n = Integer.parseInt(br.readLine());
        int[][][] list = new int[4][3][10];
        for (int i = 0; i < n; i++) {
            String[] lines = br.readLine().split(" ");
            int[] nList = new int[4];
            for (int j = 0; j < 4; j++) {
                nList[j] = Integer.parseInt(lines[j]) - 1;
            }
            list[nList[0]][nList[1]][nList[2]] += nList[3] + 1;
        }
        for (int j = 0; j < 4; j++) {
            for (int k = 0; k < 3; k++) {
                for (int l = 0; l < 10; l++) {
                    if (0 != list[j][k][l]) {
                        System.out.print(" " + list[j][k][l]);
                    } else {
                        System.out.print(" 0");
                    }
                }
                System.out.println();
            }
            if (j != 3) {
                System.out.println("####################");
            }
        }
    }
}