import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	}

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

	public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	}

} Main public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	} main {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	} int nyukyoData[][][][]; nyukyoData nyukyoData = new int [4][3][10][1] nyukyoData new int [4][3][10][1] 4 3 10 1 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		} int i=0; int i=0; i 0 i < n i n i++ i++ i {
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		} {
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		} int b = sc.nextInt()-1; b sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 int f = sc.nextInt()-1; f sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 int r = sc.nextInt()-1; r sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 nyukyoData[b][f][r][0] += sc.nextInt() nyukyoData[b][f][r][0] nyukyoData[b][f][r] nyukyoData[b][f] nyukyoData[b] nyukyoData b f r 0 sc.nextInt() sc.nextInt sc for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		} int b=0; int b=0; b 0 b < 4 b 4 b++ b++ b {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		} {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		} for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			} int f=0; int f=0; f 0 f < 3 f 3 f++ f++ f {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			} {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			} for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				} int r=0; int r=0; r 0 r < 10 r 10 r++ r++ r {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				} {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				} System.out.print(" " + nyukyoData[b][f][r][0]) System.out.print System.out System System.out " " + nyukyoData[b][f][r][0] " " nyukyoData[b][f][r][0] nyukyoData[b][f][r] nyukyoData[b][f] nyukyoData[b] nyukyoData b f r 0 if (r == 9) {
						System.out.println("");
					} r == 9 r 9 {
						System.out.println("");
					} System.out.println("") System.out.println System.out System System.out "" if (f == 2 && b != 3) {
					System.out.println("####################");
				} f == 2 && b != 3 f == 2 f 2 b != 3 b 3 {
					System.out.println("####################");
				} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	}

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

	public static void main(String[] args) {
		int nyukyoData[][][][];
		nyukyoData = new int [4][3][10][1];
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		for (int i=0; i < n; i++){
			int b = sc.nextInt()-1;
			int f = sc.nextInt()-1;
			int r = sc.nextInt()-1;
			nyukyoData[b][f][r][0] += sc.nextInt();
		}
		for (int b=0; b < 4; b++) {
			for (int f=0; f < 3; f++) {
				for(int r=0; r < 10; r++) {
					System.out.print(" " + nyukyoData[b][f][r][0]);
					if (r == 9) {
						System.out.println("");
					}
				}
				if (f == 2 && b != 3) {
					System.out.println("####################");
				}
			}
		}
	}

}