import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][][] info = new int[4][3][10];

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		}
	}

} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][][] info = new int[4][3][10];

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		}
	}

} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][][] info = new int[4][3][10];

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][][] info = new int[4][3][10];

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[][][] info = new int[4][3][10]; info new int[4][3][10] 4 3 10 for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		} {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		} for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			} {
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			} for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					info[i][j][k] = 0;
				} {
					info[i][j][k] = 0;
				} info[i][j][k] = 0 info[i][j][k] info[i][j] info[i] info i j k 0 for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		} {
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		} int tower = scanner.nextInt(); tower scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int room = scanner.nextInt(); room scanner.nextInt() scanner.nextInt scanner int member = scanner.nextInt(); member scanner.nextInt() scanner.nextInt scanner info[tower-1][f-1][room-1] += member info[tower-1][f-1][room-1] info[tower-1][f-1] info[tower-1] info tower-1 tower 1 f-1 f 1 room-1 room 1 member for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		} {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		} for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			} {
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			} for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				} int k = 0; int k = 0; k 0 k <= 9 k 9 k++ k++ k {
					System.out.print(" " + info[i][j][k]);
				} {
					System.out.print(" " + info[i][j][k]);
				} System.out.print(" " + info[i][j][k]) System.out.print System.out System System.out " " + info[i][j][k] " " info[i][j][k] info[i][j] info[i] info i j k System.out.print("\n") System.out.print System.out System System.out "\n" if(i < 3){
			System.out.println("####################");
			} i < 3 i 3 {
			System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[][][] info = new int[4][3][10];

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					info[i][j][k] = 0;
				}
			}
		}
		
		for(int i = 0; i < n; i++){
			int tower = scanner.nextInt();
			int f = scanner.nextInt();
			int room = scanner.nextInt();
			int member = scanner.nextInt();

			info[tower-1][f-1][room-1] += member;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k <= 9; k++){
					System.out.print(" " + info[i][j][k]);
				}
				System.out.print("\n");
			}
			if(i < 3){
			System.out.println("####################");
			}
		}
	}

}