public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	} main {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		} {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc house[b-1][f-1][r-1] += v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 1 v StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		} 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++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		} {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		} for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			} {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			} for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					sb.append(" " + house[i][j][k]);
				} {
					sb.append(" " + house[i][j][k]);
				} sb.append(" " + house[i][j][k]) sb.append sb " " + house[i][j][k] " " house[i][j][k] house[i][j] house[i] house i j k sb.append("\n") sb.append sb "\n" if (i==3) break; i==3 i 3 break; 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) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	}

} Main
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);

		int[][][] house = new int[4][3][10];

		int n = sc.nextInt();
		sc.nextLine();

		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();

			house[b-1][f-1][r-1] += v;
		}

		StringBuilder sb = new StringBuilder();

		for (int i=0; i<4; i++) {

			for (int j=0; j<3; j++) {

				for (int k=0; k<10; k++) {
					sb.append(" " + house[i][j][k]);
				}
				sb.append("\n");

			}
			if (i==3) break;
			sb.append("####################\n");

		}

		System.out.print(sb);
	}

}