import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		int[][][] room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n_input = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if (i < 3) {
				System.out.println("####################");
			}
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws IOException {
		int[][][] room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n_input = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if (i < 3) {
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		int[][][] room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n_input = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if (i < 3) {
				System.out.println("####################");
			}
		}
	} main {
		int[][][] room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n_input = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if (i < 3) {
				System.out.println("####################");
			}
		}
	} int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n_input = Integer.parseInt(br.readLine()); n_input Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		} int i = 0; int i = 0; i 0 i < n_input i n_input i++ i++ i {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		} {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		} String[] sz_line = (br.readLine()).split(" "); sz_line (br.readLine()).split(" ") (br.readLine()).split (br.readLine()) br.readLine br " " int block = Integer.parseInt(sz_line[0]) -1; block Integer.parseInt(sz_line[0]) -1 Integer.parseInt(sz_line[0]) Integer.parseInt Integer sz_line[0] sz_line 0 1 int floor = Integer.parseInt(sz_line[1]) -1; floor Integer.parseInt(sz_line[1]) -1 Integer.parseInt(sz_line[1]) Integer.parseInt Integer sz_line[1] sz_line 1 1 int room_number = Integer.parseInt(sz_line[2]) -1; room_number Integer.parseInt(sz_line[2]) -1 Integer.parseInt(sz_line[2]) Integer.parseInt Integer sz_line[2] sz_line 2 1 room[block][floor][room_number] += Integer.parseInt(sz_line[3]) room[block][floor][room_number] room[block][floor] room[block] room block floor room_number Integer.parseInt(sz_line[3]) Integer.parseInt Integer sz_line[3] sz_line 3 for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				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(" " + room[i][j][k]);
				}
				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(" " + room[i][j][k]);
				}
				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(" " + room[i][j][k]);
				}
				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(" " + room[i][j][k]);
				}
				System.out.println();
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + room[i][j][k]);
				} {
					System.out.print(" " + room[i][j][k]);
				} System.out.print(" " + room[i][j][k]) System.out.print System.out System System.out " " + room[i][j][k] " " room[i][j][k] room[i][j] room[i] room i j k 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.println System.out System System.out "####################" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		int[][][] room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n_input = Integer.parseInt(br.readLine());
		
		for (int i = 0; i < n_input; i++) {
			String[] sz_line = (br.readLine()).split(" ");
			int block = Integer.parseInt(sz_line[0]) -1;
			int floor = Integer.parseInt(sz_line[1]) -1;
			int room_number = Integer.parseInt(sz_line[2]) -1;
			
			room[block][floor][room_number] += Integer.parseInt(sz_line[3]);
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + room[i][j][k]);
				}
				System.out.println();
			}
			if (i < 3) {
				System.out.println("####################");
			}
		}
	}
}