import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	}

	public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	}

	public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	}
} Main void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	} run {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int home1[][] = new int[3][10]; home1 new int[3][10] 3 10 int home2[][] = new int[3][10]; home2 new int[3][10] 3 10 int home3[][] = new int[3][10]; home3 new int[3][10] 3 10 int home4[][] = new int[3][10]; home4 new int[3][10] 3 10 for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		} {
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		} int b = s.nextInt(); b s.nextInt() s.nextInt s int f = s.nextInt(); f s.nextInt() s.nextInt s int r = s.nextInt(); r s.nextInt() s.nextInt s int v = s.nextInt(); v s.nextInt() s.nextInt s if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v; b == 1 b 1 home1[f - 1][r - 1] = home1[f - 1][r - 1] + v home1[f - 1][r - 1] home1[f - 1] home1 f - 1 f 1 r - 1 r 1 home1[f - 1][r - 1] + v home1[f - 1][r - 1] home1[f - 1] home1 f - 1 f 1 r - 1 r 1 v if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v; b == 2 b 2 home2[f - 1][r - 1] = home2[f - 1][r - 1] + v home2[f - 1][r - 1] home2[f - 1] home2 f - 1 f 1 r - 1 r 1 home2[f - 1][r - 1] + v home2[f - 1][r - 1] home2[f - 1] home2 f - 1 f 1 r - 1 r 1 v if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v; b == 3 b 3 home3[f - 1][r - 1] = home3[f - 1][r - 1] + v home3[f - 1][r - 1] home3[f - 1] home3 f - 1 f 1 r - 1 r 1 home3[f - 1][r - 1] + v home3[f - 1][r - 1] home3[f - 1] home3 f - 1 f 1 r - 1 r 1 v if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v; b == 4 b 4 home4[f - 1][r - 1] = home4[f - 1][r - 1] + v home4[f - 1][r - 1] home4[f - 1] home4 f - 1 f 1 r - 1 r 1 home4[f - 1][r - 1] + v home4[f - 1][r - 1] home4[f - 1] home4 f - 1 f 1 r - 1 r 1 v for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		} int a = 0; int a = 0; a 0 a < 4 a 4 a++ a++ a {
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		} {
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		} for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[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++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			} {
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			} for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				} {
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				} if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]); a == 0 a 0 System.out.print(" " + home1[i][j]) System.out.print System.out System System.out " " + home1[i][j] " " home1[i][j] home1[i] home1 i j if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]); a == 1 a 1 System.out.print(" " + home2[i][j]) System.out.print System.out System System.out " " + home2[i][j] " " home2[i][j] home2[i] home2 i j if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]); a == 2 a 2 System.out.print(" " + home3[i][j]) System.out.print System.out System System.out " " + home3[i][j] " " home3[i][j] home3[i] home3 i j if(a == 3) System.out.print(" " + home4[i][j]); a == 3 a 3 System.out.print(" " + home4[i][j]) System.out.print System.out System System.out " " + home4[i][j] " " home4[i][j] home4[i] home4 i j System.out.println() System.out.println System.out System System.out if(a != 3) System.out.println("####################"); a != 3 a 3 System.out.println("####################") System.out.println System.out System System.out "####################" public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	} main {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	}

	public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	}
} public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	}

	public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	}
} Main
import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int home1[][] = new int[3][10];
		int home2[][] = new int[3][10];
		int home3[][] = new int[3][10];
		int home4[][] = new int[3][10];
		for(int i = 0; i < n; i++){
			int b = s.nextInt();
			int f = s.nextInt();
			int r = s.nextInt();
			int v = s.nextInt();
			if(b == 1) home1[f - 1][r - 1] = home1[f - 1][r - 1] + v;
			if(b == 2) home2[f - 1][r - 1] = home2[f - 1][r - 1] + v;
			if(b == 3) home3[f - 1][r - 1] = home3[f - 1][r - 1] + v;
			if(b == 4) home4[f - 1][r - 1] = home4[f - 1][r - 1] + v;
		}
		for(int a = 0; a < 4; a++){
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 10;j++){
					
						if (a == 0) System.out.print(" " + home1[i][j]);
						else if(a == 1) System.out.print(" " + home2[i][j]);
						else if(a == 2) System.out.print(" " + home3[i][j]);
						else if(a == 3) System.out.print(" " + home4[i][j]);
	
				}
				System.out.println();
			}
			if(a != 3) System.out.println("####################");
		}
	}

	public static void main(String[] args) {
		/* 
		 * Main x;
		 * x = new Main();
		 * x.run();
		 * ??¨????????????
		 */
		new Main().run();
		
	}
}