import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	}
} Main public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	} main {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int[][] bld = new int[15][10]; bld new int[15][10] 15 10 int cnt; cnt int lft; lft int rgt; rgt for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		} cnt = 0; cnt = 0 cnt 0 cnt < num cnt num cnt++ cnt++ cnt {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		} {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		} int rdg = sc.nextInt(); rdg sc.nextInt() sc.nextInt sc int flr = sc.nextInt(); flr sc.nextInt() sc.nextInt sc int odr = sc.nextInt(); odr sc.nextInt() sc.nextInt sc int man = sc.nextInt(); man sc.nextInt() sc.nextInt sc lft = (rdg - 1) * 4 + flr - 1 lft (rdg - 1) * 4 + flr - 1 (rdg - 1) * 4 + flr (rdg - 1) * 4 (rdg - 1) rdg 1 4 flr 1 rgt = odr - 1 rgt odr - 1 odr 1 bld[lft][rgt] += man bld[lft][rgt] bld[lft] bld lft rgt man for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		} lft = 0; lft = 0 lft 0 lft <= 14 lft 14 lft++ lft++ lft {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		} {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		} if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			} lft == 3 || lft == 7 || lft == 11 lft == 3 || lft == 7 || lft == 11 lft == 3 lft 3 lft == 7 lft 7 lft == 11 lft 11 {

				System.out.println("####################");

			} System.out.println("####################") System.out.println System.out System System.out "####################" {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			} for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				} rgt = 0; rgt = 0 rgt 0 rgt <= 9 rgt 9 rgt++ rgt++ rgt {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				} {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				} switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					} rgt case 0: 0 case 0: case 1: 1 case 1: case 2: 2 case 2: case 3: 3 case 3: case 4: 4 case 4: case 5: 5 case 5: case 6: 6 case 6: case 7: 7 case 7: case 8: 8 case 8: System.out.print(" " + bld[lft][rgt]) System.out.print System.out System System.out " " + bld[lft][rgt] " " bld[lft][rgt] bld[lft] bld lft rgt break; case 9: 9 case 9: System.out.println(" " + bld[lft][rgt]) System.out.println System.out System System.out " " + bld[lft][rgt] " " bld[lft][rgt] bld[lft] bld lft rgt break; sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ??????????????\??????????????°??¨????¬??????\???????????????????????°?????\???????????°
		int num = sc.nextInt();

		// ???????????????
		int[][] bld = new int[15][10];

		// ?????????????????°??????????????????lft:?????????????????????rgt:?????????????????????
		int cnt;
		int lft;
		int rgt;

		for (cnt = 0; cnt < num; cnt++) {

			int rdg = sc.nextInt();
			int flr = sc.nextInt();
			int odr = sc.nextInt();
			int man = sc.nextInt();

			lft = (rdg - 1) * 4 + flr - 1;
			rgt = odr - 1;

			bld[lft][rgt] += man;

		}

		for (lft = 0; lft <= 14; lft++) {

			if (lft == 3 || lft == 7 || lft == 11) {

				System.out.println("####################");

			} else {

				for (rgt = 0; rgt <= 9; rgt++) {

					switch (rgt) {

					case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
						System.out.print(" " + bld[lft][rgt]);
						break;

					case 9:
						System.out.println(" " + bld[lft][rgt]);
						break;

					}
				}
			}
		}
		sc.close();
	}
}