import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            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 tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        }

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        }

    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            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 tou1[][] = new int[n][10]; tou1 new int[n][10] n 10 int tou2[][] = new int[n][10]; tou2 new int[n][10] n 10 int tou3[][] = new int[n][10]; tou3 new int[n][10] n 10 int tou4[][] = new int[n][10]; tou4 new int[n][10] n 10 for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        } {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt() - 1; f sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int r = sc.nextInt() - 1; r sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            } {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            } tou1[i][j] = 0 tou1[i][j] tou1[i] tou1 i j 0 tou2[i][j] = 0 tou2[i][j] tou2[i] tou2 i j 0 tou3[i][j] = 0 tou3[i][j] tou3[i] tou3 i j 0 tou4[i][j] = 0 tou4[i][j] tou4[i] tou4 i j 0 switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            } b case 1: 1 case 1: tou1[f][r] = tou1[f][r] + v tou1[f][r] tou1[f] tou1 f r tou1[f][r] + v tou1[f][r] tou1[f] tou1 f r v break; case 2: 2 case 2: tou2[f][r] = tou2[f][r] + v tou2[f][r] tou2[f] tou2 f r tou2[f][r] + v tou2[f][r] tou2[f] tou2 f r v break; case 3: 3 case 3: tou3[f][r] = tou3[f][r] + v tou3[f][r] tou3[f] tou3 f r tou3[f][r] + v tou3[f][r] tou3[f] tou3 f r v break; case 4: 4 case 4: tou4[f][r] = tou4[f][r] + v tou4[f][r] tou4[f] tou4 f r tou4[f][r] + v tou4[f][r] tou4[f] tou4 f r v break; for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        } int k = 0; int k = 0; k 0 k <= 2 k 2 k++ k++ k {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        } {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        } for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            } int l = 0; int l = 0; l 0 l <= 9 l 9 l++ l++ l {
                System.out.print(" " + tou1[k][l]);
            } {
                System.out.print(" " + tou1[k][l]);
            } System.out.print(" " + tou1[k][l]) System.out.print System.out System System.out " " + tou1[k][l] " " tou1[k][l] tou1[k] tou1 k l System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        } int k = 0; int k = 0; k 0 k <= 2 k 2 k++ k++ k {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        } {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        } for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            } int l = 0; int l = 0; l 0 l <= 9 l 9 l++ l++ l {
                System.out.print(" " + tou2[k][l]);
            } {
                System.out.print(" " + tou2[k][l]);
            } System.out.print(" " + tou2[k][l]) System.out.print System.out System System.out " " + tou2[k][l] " " tou2[k][l] tou2[k] tou2 k l System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        } int k = 0; int k = 0; k 0 k <= 2 k 2 k++ k++ k {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        } {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        } for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            } int l = 0; int l = 0; l 0 l <= 9 l 9 l++ l++ l {
                System.out.print(" " + tou3[k][l]);
            } {
                System.out.print(" " + tou3[k][l]);
            } System.out.print(" " + tou3[k][l]) System.out.print System.out System System.out " " + tou3[k][l] " " tou3[k][l] tou3[k] tou3 k l System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        } int k = 0; int k = 0; k 0 k <= 2 k 2 k++ k++ k {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        } {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        } for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            } int l = 0; int l = 0; l 0 l <= 9 l 9 l++ l++ l {
                System.out.print(" " + tou4[k][l]);
            } {
                System.out.print(" " + tou4[k][l]);
            } System.out.print(" " + tou4[k][l]) System.out.print System.out System System.out " " + tou4[k][l] " " tou4[k][l] tou4[k] tou4 k l 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 tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        }

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            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 tou1[][] = new int[n][10];
        int tou2[][] = new int[n][10];
        int tou3[][] = new int[n][10];
        int tou4[][] = new int[n][10];

        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt() - 1;
            int r = sc.nextInt() - 1;
            int v = sc.nextInt();

            for (int j = 0; j < 10; j++) {
                tou1[i][j] = 0;
                tou2[i][j] = 0;
                tou3[i][j] = 0;
                tou4[i][j] = 0;

            }

            switch (b) {
                case 1:
                    tou1[f][r] = tou1[f][r] + v;
                    break;
                case 2:
                    tou2[f][r] = tou2[f][r] + v;
                    break;
                case 3:
                    tou3[f][r] = tou3[f][r] + v;
                    break;
                case 4:
                    tou4[f][r] = tou4[f][r] + v;
                    break;
            }

        }

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou1[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou2[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou3[k][l]);
            }
            System.out.println();
        }

        System.out.println("####################");

        for (int k = 0; k <= 2; k++) {
            for (int l = 0; l <= 9; l++) {
                System.out.print(" " + tou4[k][l]);
            }
            System.out.println();
        }

    }

}