import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int bfrv[][][] = new int[5][4][11]; bfrv new int[5][4][11] 5 4 11 int b = 0; b 0 int f = 0; f 0 int r = 0; r 0 int v = 0; v 0 for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        } {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        } b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc bfrv[b][f][r] += v bfrv[b][f][r] bfrv[b][f] bfrv[b] bfrv b f r v if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            } bfrv[b][f][r] < 0 bfrv[b][f][r] bfrv[b][f] bfrv[b] bfrv b f r 0 {
                bfrv[b][f][r] = 0;
            } bfrv[b][f][r] = 0 bfrv[b][f][r] bfrv[b][f] bfrv[b] bfrv b f r 0 for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        } int i = 1; int i = 1; i 1 i < 5 i 5 i++ i++ i {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        } {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        } for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            } int j = 1; int j = 1; j 1 j < 4 j 4 j++ j++ j {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            } {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            } for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                } int k = 1; int k = 1; k 1 k < 11 k 11 k++ k++ k {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                } {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(bfrv[i][j][k]) System.out.print System.out System System.out bfrv[i][j][k] bfrv[i][j] bfrv[i] bfrv i j k System.out.println("") System.out.println System.out System System.out "" if (i != 4) {
                System.out.println("####################");
            } i != 4 i 4 {
                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) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int bfrv[][][] = new int[5][4][11];
        int b = 0;
        int f = 0;
        int r = 0;
        int v = 0;
        for (int i = 0; i < n; i++) {

            b = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
            v = sc.nextInt();

            bfrv[b][f][r] += v;
            if (bfrv[b][f][r] < 0) {
                bfrv[b][f][r] = 0;
            }
        }
        for (int i = 1; i < 5; i++) {
            for (int j = 1; j < 4; j++) {
                for (int k = 1; k < 11; k++) {
                    System.out.print(" ");
                    System.out.print(bfrv[i][j][k]);
                }
                System.out.println("");
            }
            if (i != 4) {
                System.out.println("####################");
            }
        }
    }
}