import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	}

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	}

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

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	} main {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	} int kosha[][][] = new int[4][3][10]; kosha new int[4][3][10] 4 3 10 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		} int i=1; int i=1; i 1 true i++ i++ i {
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		} {
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		} if (i > n) break; i > n i n break; int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int d = scan.nextInt(); d scan.nextInt() scan.nextInt scan int A = a-1; A a-1 a 1 int B = b-1; B b-1 b 1 int C = c-1; C c-1 c 1 int D = kosha[A][B][C]; D kosha[A][B][C] kosha[A][B] kosha[A] kosha A B C kosha[A][B][C] = D + d kosha[A][B][C] kosha[A][B] kosha[A] kosha A B C D + d D d for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		} int A=0; int A=0; A 0 true A++ A++ A {
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		} {
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		} for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			} int B=0; int B=0; B 0 B<=2 B 2 B++ B++ B {
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			} {
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			} for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				} int C=0; int C=0; C 0 C<=9 C 9 C++ C++ C {
					System.out.print(" " + (kosha[A][B][C]));
				} {
					System.out.print(" " + (kosha[A][B][C]));
				} System.out.print(" " + (kosha[A][B][C])) System.out.print System.out System System.out " " + (kosha[A][B][C]) " " (kosha[A][B][C]) kosha[A][B] kosha[A] kosha A B C System.out.println("") System.out.println System.out System System.out "" if (A==3) break; A==3 A 3 break; System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		int kosha[][][] = new int[4][3][10];
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		// ??\???????????????????´?
		for(int i=1; true; i++){
			//??¶??°????¶???????????????????
			if (i > n) break;
			int a = scan.nextInt();
			int b = scan.nextInt();
			int c = scan.nextInt();
			int d = scan.nextInt();
			int A = a-1;
			int B = b-1;
			int C = c-1;
			int D = kosha[A][B][C];
			kosha[A][B][C] = D + d;
		}
		
		//?????????
		for (int A=0; true; A++){
			for(int B=0; B<=2; B++){
				for(int C=0; C<=9; C++){
					System.out.print(" " + (kosha[A][B][C]));
				}
				System.out.println("");
			}
			if (A==3) break;
			System.out.println("####################");
		}
		
	}

}