import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][][] bldgs = new int[4][3][10]; bldgs new int[4][3][10] 4 3 10 for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		} int b, f, r, v, i = 0; int b b f f r r v v i = 0; i 0 i < n i n i++ i++ i {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		} {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		} b = sc.nextInt() - 1 b sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 f = sc.nextInt() - 1 f sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 r = sc.nextInt() - 1 r sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 v = sc.nextInt() v sc.nextInt() sc.nextInt sc bldgs[b][f][r] += v bldgs[b][f][r] bldgs[b][f] bldgs[b] bldgs b f r v int tmp = bldgs[b][f][r]; tmp bldgs[b][f][r] bldgs[b][f] bldgs[b] bldgs b f r bldgs[b][f][r] = tmp < 0 ? 0 : tmp bldgs[b][f][r] bldgs[b][f] bldgs[b] bldgs b f r tmp < 0 ? 0 : tmp tmp < 0 tmp 0 0 tmp sc.close() sc.close sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() boolean flag = true; flag true for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		} int[][] f bldgs {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		} {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		} if (flag) flag = false;
			else sb.append("####################\n"); flag flag = false flag false sb.append("####################\n") sb.append sb "####################\n" for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			} int[] r f {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			} {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			} for (int v : r) {
					sb.append(" ").append(v);
				} int v r {
					sb.append(" ").append(v);
				} {
					sb.append(" ").append(v);
				} sb.append(" ").append(v) sb.append(" ").append sb.append(" ") sb.append sb " " v sb.append("\n") sb.append sb "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		// [house] [floor] [room]
		int[][][] bldgs = new int[4][3][10];

		for (int b, f, r, v, i = 0; i < n; i++) {
			b = sc.nextInt() - 1;
			f = sc.nextInt() - 1;
			r = sc.nextInt() - 1;
			v = sc.nextInt();
			bldgs[b][f][r] += v;
			int tmp = bldgs[b][f][r];
			bldgs[b][f][r] = tmp < 0 ? 0 : tmp;
		}

		sc.close();

		StringBuilder sb = new StringBuilder();
		boolean flag = true;;
		
		for (int[][] f : bldgs) {
			if (flag) flag = false;
			else sb.append("####################\n");
			
			for (int[] r : f) {
				for (int v : r) {
					sb.append(" ").append(v);
				}
				sb.append("\n");
			}
		}
		System.out.print(sb);
	}
}