import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int b = 5; b 5 int f = 4; f 4 int r = 11; r 11 int count[][][] = new int[b][f][r]; count new int[b][f][r] b f r for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		} b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc count[b][f][r] += sc.nextInt() count[b][f][r] count[b][f] count[b] count b f r sc.nextInt() sc.nextInt sc for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		} {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		} for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			} int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			} {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			} for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				} int k = 0; int k = 0; k 0 k < 11 k 11 k++ k++ k {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				} {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				} if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					} i != 0 && j != 0 && k != 0 i != 0 && j != 0 && k != 0 i != 0 i 0 j != 0 j 0 k != 0 k 0 {
						System.out.print(" " + count[i][j][k]);
					} System.out.print(" " + count[i][j][k]) System.out.print System.out System System.out " " + count[i][j][k] " " count[i][j][k] count[i][j] count[i] count i j k if (i != 0 && j != 0) {
					System.out.println();
				} i != 0 && j != 0 i != 0 i 0 j != 0 j 0 {
					System.out.println();
				} System.out.println() System.out.println System.out System System.out if (i < 4 && i != 0) {
				System.out.println("####################");
			} i < 4 && i != 0 i < 4 i 4 i != 0 i 0 {
				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) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int b = 5;
		int f = 4;
		int r = 11;
		int count[][][] = new int[b][f][r];
		for (int i = 0; i < n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			count[b][f][r] += sc.nextInt();
		}
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 4; j++) {
				for (int k = 0; k < 11; k++) {
					if (i != 0 && j != 0 && k != 0) {
						System.out.print(" " + count[i][j][k]);
					}
				}
				if (i != 0 && j != 0) {
					System.out.println();
				}
			}
			if (i < 4 && i != 0) {
				System.out.println("####################");
			}
		}
	}
}
