import java.util.Scanner;

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

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    }
}
 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[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] A = new int[3][10]; A new int[3][10] 3 10 int[][] B = new int[3][10]; B new int[3][10] 3 10 int[][] C = new int[3][10]; C new int[3][10] 3 10 int[][] D = new int[3][10]; D new int[3][10] 3 10 for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        } {
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        } for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0; int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0; A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0 A[i][j] A[i] A i j B[i][j] = C[i][j] = D[i][j] = 0 B[i][j] B[i] B i j C[i][j] = D[i][j] = 0 C[i][j] C[i] C i j D[i][j] = 0 D[i][j] D[i] D i j 0 int time = sc.nextInt(); time sc.nextInt() sc.nextInt sc for(int i = 0; i < time; i++){
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        } int i = 0; int i = 0; i 0 i < time i time i++ i++ i {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        } {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[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 if(b == 1)
                A[f - 1][r - 1] += v; b == 1 b 1 A[f - 1][r - 1] += v A[f - 1][r - 1] A[f - 1] A f - 1 f 1 r - 1 r 1 v if(b == 2)
                B[f - 1][r - 1] += v; b == 2 b 2 B[f - 1][r - 1] += v B[f - 1][r - 1] B[f - 1] B f - 1 f 1 r - 1 r 1 v if(b == 3)
                C[f - 1][r - 1] += v; b == 3 b 3 C[f - 1][r - 1] += v C[f - 1][r - 1] C[f - 1] C f - 1 f 1 r - 1 r 1 v if(b == 4)
                D[f - 1][r - 1] += v; b == 4 b 4 D[f - 1][r - 1] += v D[f - 1][r - 1] D[f - 1] D f - 1 f 1 r - 1 r 1 v for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        } {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        } for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]); int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j System.out.print(" " + A[i][j]); System.out.print(" " + A[i][j]) System.out.print System.out System System.out " " + A[i][j] " " A[i][j] A[i] A i j System.out.println("") System.out.println System.out System System.out "" System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        } {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        } for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]); int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j System.out.print(" " + B[i][j]); System.out.print(" " + B[i][j]) System.out.print System.out System System.out " " + B[i][j] " " B[i][j] B[i] B i j System.out.println("") System.out.println System.out System System.out "" System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        } {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        } for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]); int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j System.out.print(" " + C[i][j]); System.out.print(" " + C[i][j]) System.out.print System.out System System.out " " + C[i][j] " " C[i][j] C[i] C i j System.out.println("") System.out.println System.out System System.out "" System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        } {
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        } for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]); int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j System.out.print(" " + D[i][j]); System.out.print(" " + D[i][j]) System.out.print System.out System System.out " " + D[i][j] " " D[i][j] D[i] D i j System.out.println("") System.out.println System.out System System.out "" sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    }
} Main
import java.util.Scanner;

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

        int[][] A = new int[3][10];
        int[][] B = new int[3][10];
        int[][] C = new int[3][10];
        int[][] D = new int[3][10];

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                A[i][j] = B[i][j] = C[i][j] = D[i][j] = 0;
        }

        int time = sc.nextInt();

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

            if(b == 1)
                A[f - 1][r - 1] += v;
            if(b == 2)
                B[f - 1][r - 1] += v;
            if(b == 3)
                C[f - 1][r - 1] += v;
            if(b == 4)
                D[f - 1][r - 1] += v;
        }

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + A[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + B[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + C[i][j]);
            System.out.println("");
        }
        System.out.println("####################");
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 10; j++)
                System.out.print(" " + D[i][j]);
            System.out.println("");
        }
        
        sc.close();
    }
}

