import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		}
	}

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		}
	}

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

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		}
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int OffHouse[][][] = new int[4][3][10]; OffHouse new int[4][3][10] 4 3 10 for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		} 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();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		} {

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		} 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 OffHouse[b-1][f-1][r-1] += scan.nextInt() OffHouse[b-1][f-1][r-1] OffHouse[b-1][f-1] OffHouse[b-1] OffHouse b-1 b 1 f-1 f 1 r-1 r 1 scan.nextInt() scan.nextInt scan scan.close() scan.close scan for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		} int i=0; int i=0; i 0 i<4 i 4 i++ i++ i { //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		} { //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		} for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			} int s=0; int s=0; s 0 s<3 s 3 s++ s++ s { //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			} { //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			} for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					} int t=0; int t=0; t 0 t<10 t 10 t++ t++ t { //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					} { //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					} System.out.print(" " + OffHouse[i][s][t]) System.out.print System.out System System.out " " + OffHouse[i][s][t] " " OffHouse[i][s][t] OffHouse[i][s] OffHouse[i] OffHouse i s t System.out.print("\n") System.out.print System.out System System.out "\n" if(i != 3 && s == 2)
					System.out.println("####################"); i != 3 && s == 2 i != 3 i 3 s == 2 s 2 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int OffHouse[][][] = new int[4][3][10];
		for(int i=0; i<n; i++){

			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			OffHouse[b-1][f-1][r-1] += scan.nextInt();
		}
		scan.close();
		for(int i=0; i<4; i++){ //棟
			for(int s=0; s<3; s++){ //階
				for(int t=0; t<10; t++){ //部屋
						System.out.print(" " + OffHouse[i][s][t]);
					}
				System.out.print("\n");
				if(i != 3 && s == 2)
					System.out.println("####################");
			}
		}
	}

}