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();
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz