import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    }

    static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    }

    static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

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

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    } main {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] a = new int[4][3][10]; a new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

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

            a[b - 1][f - 1][r - 1] += v;
        } {

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

            a[b - 1][f - 1][r - 1] += v;
        } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc a[b - 1][f - 1][r - 1] += v a[b - 1][f - 1][r - 1] a[b - 1][f - 1] a[b - 1] a b - 1 b 1 f - 1 f 1 r - 1 r 1 v printHouse(a) printHouse a sc.close() sc.close sc String[] args args static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    } printHouse {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    } for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                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(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[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(" " + a[i][j][k]);
                }
                System.out.print("\n");
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            } for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.print(" " + a[i][j][k]);
                } {
                    System.out.print(" " + a[i][j][k]);
                } System.out.print(" " + a[i][j][k]) System.out.print System.out System System.out " " + a[i][j][k] " " a[i][j][k] a[i][j] a[i] a i j k System.out.print("\n") System.out.print System.out System System.out "\n" if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            } i != 3 i 3 {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            } for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                } int l = 0; int l = 0; l 0 l < 20 l 20 l++ l++ l {
                    System.out.print("#");
                } {
                    System.out.print("#");
                } System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n" int[][][] a a public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    }

    static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    }

    static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int[][][] a = new int[4][3][10];

        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {

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

            a[b - 1][f - 1][r - 1] += v;
        }

        printHouse(a);

        sc.close();
    }

    static void printHouse(int[][][] a) {

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + a[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) {
                for (int l = 0; l < 20; l++) {
                    System.out.print("#");
                }
                System.out.print("\n");
            }

        }
    }
}
