import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	} main {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	} Scanner scan = new Scanner (System.in); scan new Scanner (System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int[] [] []   officialHouse = new int[4] [3] [10]; officialHouse new int[4] [3] [10] 4 3 10 int building = 0; building 0 int floor = 0; floor 0 int roomNumber = 0; roomNumber 0 int residents = 0; residents 0 for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		} {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		} building = scan.nextInt() building scan.nextInt() scan.nextInt scan floor = scan.nextInt() floor scan.nextInt() scan.nextInt scan roomNumber = scan.nextInt() roomNumber scan.nextInt() scan.nextInt scan residents = scan.nextInt() residents scan.nextInt() scan.nextInt scan officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents officialHouse[building - 1] [floor - 1] [roomNumber - 1] officialHouse[building - 1] [floor - 1] officialHouse[building - 1] officialHouse building - 1 building 1 floor - 1 floor 1 roomNumber - 1 roomNumber 1 residents for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			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(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			} 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(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + officialHouse [i] [j] [k]);
				} {
					System.out.print(" " + officialHouse [i] [j] [k]);
				} System.out.print(" " + officialHouse [i] [j] [k]) System.out.print System.out System System.out " " + officialHouse [i] [j] [k] " " officialHouse [i] [j] [k] officialHouse [i] [j] officialHouse [i] officialHouse i j k System.out.println() System.out.println System.out System System.out if (j == 3) {
					break;
				} j == 3 j 3 {
					break;
				} break; if (i == 3) {
				break;
			} i == 3 i 3 {
				break;
			} break; System.out.println("####################") System.out.println System.out System System.out "####################" scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);
		int num = scan.nextInt();

		int[] [] []   officialHouse = new int[4] [3] [10];

		int building = 0;
		int floor = 0;
		int roomNumber = 0;
		int residents = 0;

		for (int i = 0; i < num; i++) {
			building = scan.nextInt();
			floor = scan.nextInt();
			roomNumber = scan.nextInt();
			residents = scan.nextInt();

			officialHouse[building - 1] [floor - 1] [roomNumber - 1] += residents;

		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + officialHouse [i] [j] [k]);
				}
				System.out.println();
				if (j == 3) {
					break;
				}

			}
			if (i == 3) {
				break;
			}
			System.out.println("####################");
		}
		scan.close();
	}
}