import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int[][][][] data = new int[4][3][10][1]; data new int[4][3][10][1] 4 3 10 1 for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		} {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		} int building = sc.nextInt(); building sc.nextInt() sc.nextInt sc int floor = sc.nextInt(); floor sc.nextInt() sc.nextInt sc int room = sc.nextInt(); room sc.nextInt() sc.nextInt sc int person = sc.nextInt(); person sc.nextInt() sc.nextInt sc data[building-1][floor-1][room-1][0] += person data[building-1][floor-1][room-1][0] data[building-1][floor-1][room-1] data[building-1][floor-1] data[building-1] data building-1 building 1 floor-1 floor 1 room-1 room 1 0 person for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			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 < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		} {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		} for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			} {
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			} for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + data[i][j][k][0]);
				} {
					System.out.print(" " + data[i][j][k][0]);
				} System.out.print(" " + data[i][j][k][0]) System.out.print System.out System System.out " " + data[i][j][k][0] " " data[i][j][k][0] data[i][j][k] data[i][j] data[i] data i j k 0 System.out.println() System.out.println System.out System System.out if(i != 3)
			System.out.println("####################"); i != 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int[][][][] data = new int[4][3][10][1];

		for (int i = 0; i < a; i++) {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room = sc.nextInt();
			int person = sc.nextInt();
			data[building-1][floor-1][room-1][0] += person;
		}

		for (int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					System.out.print(" " + data[i][j][k][0]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}
	}

}