
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + list[i][j][k]);
				}
				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 scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	} main {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a 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 < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		} {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		} int b = scanner.nextInt() - 1; b scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int c = scanner.nextInt() - 1; c scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int d = scanner.nextInt() - 1; d scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int e = scanner.nextInt(); e scanner.nextInt() scanner.nextInt scanner list[b][c][d] += e list[b][c][d] list[b][c] list[b] list b c d e for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + list[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(" " + list[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(" " + list[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(" " + list[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(" " + list[i][j][k]);
				}
				System.out.println();
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + list[i][j][k]);
				}
				System.out.println();
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + list[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + list[i][j][k]);
				} {
					System.out.print(" " + list[i][j][k]);
				} System.out.print(" " + list[i][j][k]) System.out.print System.out System System.out " " + list[i][j][k] " " list[i][j][k] list[i][j] list[i] list 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 System System.out "####################" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int[][][] list = new int[4][3][10];
		for (int i = 0; i < a; i++) {
			int b = scanner.nextInt() - 1;
			int c = scanner.nextInt() - 1;
			int d = scanner.nextInt() - 1;
			int e = scanner.nextInt();
			list[b][c][d] += e;
		}

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

	}
}