import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	}
} Main public static void main(String[] args) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	} main {

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	} int numN; numN int build; build int floor; floor int room; room int menber = 0; menber 0 String s = ""; s "" String output = ""; output "" int college[][][] = new int[4][3][10]; college new int[4][3][10] 4 3 10 String[] NumList = new String[4]; NumList new String[4] 4 Scanner sc = null; sc null try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		} {
			sc.close();
		} sc.close() sc.close sc {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} sc = new Scanner(System.in) sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc numN = n numN n for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			} int i = 1; int i = 1; i 1 i <= numN i numN i++ i++ i {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			} {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			} for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				} int j = 0; int j = 0; j 0 j < NumList.length j NumList.length NumList NumList.length j++ j++ j {

					s = sc.next();
					NumList[j] = s;
				} {

					s = sc.next();
					NumList[j] = s;
				} s = sc.next() s sc.next() sc.next sc NumList[j] = s NumList[j] NumList j s build  = (Integer.parseInt(NumList[0])) - 1 build (Integer.parseInt(NumList[0])) - 1 (Integer.parseInt(NumList[0])) Integer.parseInt Integer NumList[0] NumList 0 1 floor  = (Integer.parseInt(NumList[1])) - 1 floor (Integer.parseInt(NumList[1])) - 1 (Integer.parseInt(NumList[1])) Integer.parseInt Integer NumList[1] NumList 1 1 room   = (Integer.parseInt(NumList[2])) - 1 room (Integer.parseInt(NumList[2])) - 1 (Integer.parseInt(NumList[2])) Integer.parseInt Integer NumList[2] NumList 2 1 menber = Integer.parseInt(NumList[3]) menber Integer.parseInt(NumList[3]) Integer.parseInt Integer NumList[3] NumList 3 college[build][floor][room] += menber college[build][floor][room] college[build][floor] college[build] college build floor room menber for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			} int i = 0; int i = 0; i 0 i < college.length i college.length college college.length i++ i++ i {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			} {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			} for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				} int j = 0; int j = 0; j 0 j < college[0].length j college[0].length college[0] college 0 college[0].length j++ j++ j {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				} {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				} for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					} int k = 0; int k = 0; k 0 k < college[0][0].length k college[0][0].length college[0][0] college[0] college 0 0 college[0][0].length k++ k++ k {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					} {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					} output += " " output " " output += college[i][j][k] output college[i][j][k] college[i][j] college[i] college i j k System.out.println(output) System.out.println System.out System System.out output output = "" output "" if(i != college.length - 1){
					System.out.println("####################");
				} i != college.length - 1 i college.length - 1 college.length college college.length 1 {
					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) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	}
} public class Main {

	public static void main(String[] args) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws NumberFormatException{

		//?????£?????????
		int numN;
		int build;
		int floor;
		int room;
		int menber = 0;
		
		String s = "";
		String output = "";

		//[?£?][????±?][??¨?±?]
		int college[][][] = new int[4][3][10];
		String[] NumList = new String[4];

		Scanner sc = null;

		try {

				sc = new Scanner(System.in);
			int n = sc.nextInt();

			//?????????????????°?????£??\
			numN = n;

			//?????±???????????????
			for (int i = 1; i <= numN; i++) {

				for (int j = 0; j < NumList.length; j++) {

					s = sc.next();
					NumList[j] = s;
				}

				build  = (Integer.parseInt(NumList[0])) - 1;
				floor  = (Integer.parseInt(NumList[1])) - 1;
				room   = (Integer.parseInt(NumList[2])) - 1;
				menber = Integer.parseInt(NumList[3]);

				//?????±?????????
				college[build][floor][room] += menber;

				//??¨?±?????????°????????????
				//menber = 0;
			}

			for (int i = 0; i < college.length; i++) {

				for (int j = 0; j < college[0].length; j++) {
					//????????????
					for (int k = 0; k < college[0][0].length; k++) {
						output += " ";
						//??¨?±??????????
						output += college[i][j][k];
					}
					System.out.println(output);
					output = "";
				}
				if(i != college.length - 1){
					System.out.println("####################");
				}
			}
		} finally {
			sc.close();
		}
	}
}