import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	} main {
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] intRoom = new int[4][3][10]; intRoom new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		} {
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		} int intBuilding = sc.nextInt(); intBuilding sc.nextInt() sc.nextInt sc int intFloor = sc.nextInt(); intFloor sc.nextInt() sc.nextInt sc int intRoomFirst = sc.nextInt(); intRoomFirst sc.nextInt() sc.nextInt sc int intPeople = sc.nextInt(); intPeople sc.nextInt() sc.nextInt sc intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] intRoom[intBuilding - 1][intFloor -1] intRoom[intBuilding - 1] intRoom intBuilding - 1 intBuilding 1 intFloor -1 intFloor 1 intRoomFirst -1 intRoomFirst 1 intPeople for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[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(" " + intRoom[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(" " + intRoom[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(" " + intRoom[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(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			} {
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			} for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				} int k = 0; int k = 0; k 0 k< 10 k 10 k++ k++ k {
					System.out.print(" " + intRoom[i][j][k]);
				} {
					System.out.print(" " + intRoom[i][j][k]);
				} System.out.print(" " + intRoom[i][j][k]) System.out.print System.out System System.out " " + intRoom[i][j][k] " " intRoom[i][j][k] intRoom[i][j] intRoom[i] intRoom 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.println System.out System System.out "####################" String[] args args public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//
		int[][][] intRoom = new int[4][3][10];
		//n??¶????????±?????????
		int n = sc.nextInt();

		//2????????\????????????
		for(int i = 0; i < n; i++){
			//??´ b
			int intBuilding = sc.nextInt();
			//??? f
			int intFloor = sc.nextInt();
			//??¨?±? r
			int intRoomFirst = sc.nextInt();
			//?????° v
			int intPeople = sc.nextInt();
			//??\??????????????????????´?
			intRoom[intBuilding - 1][intFloor -1][intRoomFirst -1] += intPeople;
		}
		//??????
		for(int i = 0; i< 4; i++){
			for(int j = 0; j<3; j++){
				for(int k = 0; k< 10; k++){
					System.out.print(" " + intRoom[i][j][k]);
				}
				System.out.println(""); //??????
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
}