public class Main {
	public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	}
} public class Main {
	public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	}
} Main public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	} main {
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	} java.util.Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan 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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		} {
			for(int j = 0;j<10;j++){
				A[i][j] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		} for(int j = 0;j<10;j++){
				A[i][j] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			} int j = 0; int j = 0; j 0 j<10 j 10 j++ j++ j {
				A[i][j] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			} {
				A[i][j] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			} A[i][j] = 0 A[i][j] A[i] A i j 0 B[i][j] = 0 B[i][j] B[i] B i j 0 C[i][j] = 0 C[i][j] C[i] C i j 0 D[i][j] = 0 D[i][j] D[i] D i j 0 for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else if(b == 4){
				D[f-1][r-1] += v;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else if(b == 4){
				D[f-1][r-1] += v;
			}
		} {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else if(b == 4){
				D[f-1][r-1] += v;
			}
		} int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else if(b == 4){
				D[f-1][r-1] += v;
			} b == 1 b 1 {
				A[f-1][r-1] += v;
			} 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;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else if(b == 4){
				D[f-1][r-1] += v;
			} b == 2 b 2 {
				B[f-1][r-1] += v;
			} 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;
			}else if(b == 4){
				D[f-1][r-1] += v;
			} b == 3 b 3 {
				C[f-1][r-1] += v;
			} 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] += 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(" "+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(" "+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(" "+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(" "+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 String[] main main public class Main {
	public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	}
} public class Main {
	public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	}
} Main
public class Main {
	public static void main(String[] main){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		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] = 0;
				B[i][j] = 0;
				C[i][j] = 0;
				D[i][j] = 0;
			}
		}
		for(int i = 0; i < n;i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if(b == 1){
				A[f-1][r-1] += v;
			}else if(b == 2){
				B[f-1][r-1] += v;
			}else if(b == 3){
				C[f-1][r-1] += v;
			}else 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();
		}
	}
}