import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] house = new int[4][3][10];
        int i, j, k;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        }
        int n = Integer.parseInt(br.readLine());
        String[] input;
        int b, f, r ,v;
        for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        }
        String output;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        }
    }
} import java.io.*; io.* java class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] house = new int[4][3][10];
        int i, j, k;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        }
        int n = Integer.parseInt(br.readLine());
        String[] input;
        int b, f, r ,v;
        for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        }
        String output;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        }
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] house = new int[4][3][10];
        int i, j, k;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        }
        int n = Integer.parseInt(br.readLine());
        String[] input;
        int b, f, r ,v;
        for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        }
        String output;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] house = new int[4][3][10];
        int i, j, k;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        }
        int n = Integer.parseInt(br.readLine());
        String[] input;
        int b, f, r ,v;
        for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        }
        String output;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 int i i j j k; k for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        } i = 0; i = 0 i 0 i < 4 i 4 i++ i++ i {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        } {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        } for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            } j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            } {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            } for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                } k = 0; 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(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] input; input int b b f f r r v; v for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        } i = 0; i = 0 i 0 i < n i n i++ i++ i {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        } {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        } input = br.readLine().split(" ") input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b = Integer.parseInt(input[0]) - 1 b Integer.parseInt(input[0]) - 1 Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 1 f = Integer.parseInt(input[1]) - 1 f Integer.parseInt(input[1]) - 1 Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 1 r = Integer.parseInt(input[2]) - 1 r Integer.parseInt(input[2]) - 1 Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 1 v = Integer.parseInt(input[3]) v Integer.parseInt(input[3]) Integer.parseInt Integer input[3] input 3 house[b][f][r] += v house[b][f][r] house[b][f] house[b] house b f r v String output; output for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        } i = 0; i = 0 i 0 i < 4 i 4 i++ i++ i {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        } {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        } for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            } j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            } {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            } output = "" output "" for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                } k = 0; k = 0 k 0 k < 10 k 10 k++ k++ k {
                    output += " " + house[i][j][k];
                } {
                    output += " " + house[i][j][k];
                } output += " " + house[i][j][k] output " " + house[i][j][k] " " house[i][j][k] house[i][j] house[i] house i j k System.out.println(output) System.out.println System.out System System.out output if (i != 3) System.out.println("####################"); i != 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.io.*;

class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][][] house = new int[4][3][10];
        int i, j, k;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                for (k = 0; k < 10; k++) {
                    house[i][j][k] = 0;
                }
            }
        }
        int n = Integer.parseInt(br.readLine());
        String[] input;
        int b, f, r ,v;
        for (i = 0; i < n; i++) {
            input = br.readLine().split(" ");
            b = Integer.parseInt(input[0]) - 1;
            f = Integer.parseInt(input[1]) - 1;
            r = Integer.parseInt(input[2]) - 1;
            v = Integer.parseInt(input[3]);
            house[b][f][r] += v;
        }
        String output;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 3; j++) {
                output = "";
                for (k = 0; k < 10; k++) {
                    output += " " + house[i][j][k];
                }
                System.out.println(output);
            }
            if (i != 3) System.out.println("####################");
        }
    }
}