import java.util.Scanner;

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

		for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		}

		for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[][][] list = new int[4][3][10];

		for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		}

		for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		}
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[][][] list = new int[4][3][10];

		for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		}

		for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		int length = scanner.nextInt();
		int[][][] list = new int[4][3][10];

		for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		}

		for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int length = scanner.nextInt(); length scanner.nextInt() scanner.nextInt scanner int[][][] list = new int[4][3][10]; list new int[4][3][10] 4 3 10 for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		} {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		} list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt() list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] list[scanner.nextInt() - 1][scanner.nextInt() - 1] list[scanner.nextInt() - 1] list scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				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 i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		} {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		} for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			} int i2 = 0; int i2 = 0; i2 0 i2 < 3 i2 3 i2++ i2++ i2 {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			} {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			} for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				} int i3 = 0; int i3 = 0; i3 0 i3 < 10 i3 10 i3++ i3++ i3 {
					System.out.print(" " + list[i][i2][i3]);
				} {
					System.out.print(" " + list[i][i2][i3]);
				} System.out.print(" " + list[i][i2][i3]) System.out.print System.out System System.out " " + list[i][i2][i3] " " list[i][i2][i3] list[i][i2] list[i] list i i2 i3 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
import java.util.Scanner;

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

		for (int i = 0; i < length; i++) {
			list[scanner.nextInt() - 1][scanner.nextInt() - 1][scanner.nextInt() - 1] += scanner.nextInt();
		}

		for (int i = 0; i < 4; i++) {
			for (int i2 = 0; i2 < 3; i2++) {
				for (int i3 = 0; i3 < 10; i3++) {
					System.out.print(" " + list[i][i2][i3]);
				}

				System.out.println();
			}

			if (i != 3)
				System.out.println("####################");
		}
	}
}