import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} Main public static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	} main {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	} int n = input(); n input() input int[][][] arrays = new int[4][3][10]; arrays new int[4][3][10] 4 3 10 for (int i = 0; i < n; i++) {

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		} {

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		} int b = input(); b input() input int f = input(); f input() input int r = input(); r input() input int v = input(); v input() input v =+ v v + v v arrays[b - 1][f - 1][r - 1] += v arrays[b - 1][f - 1][r - 1] arrays[b - 1][f - 1] arrays[b - 1] arrays b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int j = 0; j < 4; j++) {

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		} {

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			} {

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			} for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				} int l = 0; int l = 0; l 0 l < 10 l 10 l++ l++ l {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				} {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				} System.out.print(" ") System.out.print System.out System System.out " " System.out.print(arrays[j][k][l]) System.out.print System.out System System.out arrays[j][k][l] arrays[j][k] arrays[j] arrays j k l System.out.println("") System.out.println System.out System System.out "" if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			} j + 1 != 4 j + 1 j 1 4 {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			} for (int m = 0; m < 20; m++) {

					System.out.print("#");

				} int m = 0; int m = 0; m 0 m < 20 m 20 m++ m++ m {

					System.out.print("#");

				} {

					System.out.print("#");

				} System.out.print("#") System.out.print System.out System System.out "#" System.out.println("") System.out.println System.out System System.out "" close() close String[] args args public static int input() {

		return scanner.nextInt();

	} input {

		return scanner.nextInt();

	} return scanner.nextInt(); scanner.nextInt() scanner.nextInt scanner public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	} close {

		if (scanner != null) {

			scanner.close();

		}
	} if (scanner != null) {

			scanner.close();

		} scanner != null scanner null {

			scanner.close();

		} scanner.close() scanner.close scanner public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {

		int n = input();
		int[][][] arrays = new int[4][3][10];

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

			int b = input();
			int f = input();
			int r = input();
			int v = input();

			v =+ v;

			arrays[b - 1][f - 1][r - 1] += v;

		}

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

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

				for (int l = 0; l < 10; l++) {


					System.out.print(" ");
					System.out.print(arrays[j][k][l]);

				}

				System.out.println("");

			}

			if (j + 1 != 4) {

				for (int m = 0; m < 20; m++) {

					System.out.print("#");

				}

				System.out.println("");

			}
		}

		close();

	}

	public static int input() {

		return scanner.nextInt();

	}

	public static void close() {

		if (scanner != null) {

			scanner.close();

		}
	}
}