

import java.util.Scanner;

public class Main{

	/*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{

	/*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	}
} Main /*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	} main {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	} int[][][] hoUse = new int[4][3][10]; hoUse new int[4][3][10] 4 3 10 int building building floor floor room room people; people Scanner scAner = new Scanner(System.in); scAner new Scanner(System.in) int info = scAner.nextInt(); info scAner.nextInt() scAner.nextInt scAner for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0; int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0; for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0; int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0; for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0; int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k hoUse[i][j][k] = 0; hoUse[i][j][k] = 0 hoUse[i][j][k] hoUse[i][j] hoUse[i] hoUse i j k 0 for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		} int i = 0; int i = 0; i 0 i < info i info i++ i++ i {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		} {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		} building = scAner.nextInt() building scAner.nextInt() scAner.nextInt scAner floor = scAner.nextInt() floor scAner.nextInt() scAner.nextInt scAner room = scAner.nextInt() room scAner.nextInt() scAner.nextInt scAner people = scAner.nextInt() people scAner.nextInt() scAner.nextInt scAner hoUse[building - 1][floor - 1][room - 1] += people hoUse[building - 1][floor - 1][room - 1] hoUse[building - 1][floor - 1] hoUse[building - 1] hoUse building - 1 building 1 floor - 1 floor 1 room - 1 room 1 people for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + hoUse[i][j][k]);
				} {
					System.out.print(" " + hoUse[i][j][k]);
				} System.out.print(" " + hoUse[i][j][k]) System.out.print System.out System System.out " " + hoUse[i][j][k] " " hoUse[i][j][k] hoUse[i][j] hoUse[i] hoUse i j k System.out.println("") System.out.println System.out System System.out "" if (i < 3)
				System.out.println("####################"); i < 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main{

	/*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	}
} public class Main{

	/*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	}
} Main


import java.util.Scanner;

public class Main{

	/*
	 * A??§??? ??????????????????????????????????£? ??\????±????????????±?????????????????§?????°?????????
	 *
	 * ??????????????± ??¢?£? ?????? ????????? ??¶?????°
	 *
	 * ????£???????????????????????????????????????????????????\?±??????°????????????????????? ?????????????????????????????????????????????????????????????????????????????¨?±??????\?±??????°??????????????????????????????
	 * ??\?±??????°?????????????????????????????????????????????????????? ????£????????????? #################### (20?????? # )
	 */
	public static void main(String[] args) {

		// ??????????????????????????????????£?
		int[][][] hoUse = new int[4][3][10];

		// ??????????????±
		// ??¢?£? ?????? ????????? ??¶?????°
		int building, floor, room, people;

		Scanner scAner = new Scanner(System.in);
		int info = scAner.nextInt();

		for (int i = 0; i < 4; i++)
			for (int j = 0; j < 3; j++)
				for (int k = 0; k < 10; k++)
					hoUse[i][j][k] = 0;

		for (int i = 0; i < info; i++) {
			// ex 3
			// 1 1 3 8
			// 3 2 2 7
			// 4 3 8 1
			building = scAner.nextInt();
			floor = scAner.nextInt();
			room = scAner.nextInt();
			people = scAner.nextInt();

			hoUse[building - 1][floor - 1][room - 1] += people;
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + hoUse[i][j][k]);
				}
				System.out.println("");
			}
			if (i < 3)
				System.out.println("####################");
		}
	}
}