import java.io.*;
class Main{
	public static void main(String[] args)  throws IOException{ 
		int[][][] Room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	String str = br.readLine();
		int line = Integer.parseInt(str);

		for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	}
 
 	        for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		}
	}
} import java.io.*; io.* java class Main{
	public static void main(String[] args)  throws IOException{ 
		int[][][] Room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	String str = br.readLine();
		int line = Integer.parseInt(str);

		for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	}
 
 	        for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		}
	}
} Main public static void main(String[] args)  throws IOException{ 
		int[][][] Room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	String str = br.readLine();
		int line = Integer.parseInt(str);

		for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	}
 
 	        for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		}
	} main { 
		int[][][] Room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	String str = br.readLine();
		int line = Integer.parseInt(str);

		for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	}
 
 	        for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		}
	} int[][][] Room = new int[4][3][10]; Room new int[4][3][10] 4 3 10 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br int line = Integer.parseInt(str); line Integer.parseInt(str) Integer.parseInt Integer str for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	} int i = 0; int i = 0; i 0 i < line i line i++ i++ i {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	} {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	} String str2 = br.readLine(); str2 br.readLine() br.readLine br String[] str3 = str2.split(" "); str3 str2.split(" ") str2.split str2 " " int Building = Integer.parseInt(str3[0]); Building Integer.parseInt(str3[0]) Integer.parseInt Integer str3[0] str3 0 int Floor = Integer.parseInt(str3[1]); Floor Integer.parseInt(str3[1]) Integer.parseInt Integer str3[1] str3 1 int RoomFirst = Integer.parseInt(str3[2]); RoomFirst Integer.parseInt(str3[2]) Integer.parseInt Integer str3[2] str3 2 int People = Integer.parseInt(str3[3]); People Integer.parseInt(str3[3]) Integer.parseInt Integer str3[3] str3 3 Room[Building -1][Floor -1][RoomFirst -1] += People Room[Building -1][Floor -1][RoomFirst -1] Room[Building -1][Floor -1] Room[Building -1] Room Building -1 Building 1 Floor -1 Floor 1 RoomFirst -1 RoomFirst 1 People for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		} int l = 0; int l = 0; l 0 l < 4 l 4 l++ l++ l {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		} {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		} for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][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(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	} {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	} for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                        		System.out.print(" " + Room[l][j][k]);
                    		} {
                        		System.out.print(" " + Room[l][j][k]);
                    		} System.out.print(" " + Room[l][j][k]) System.out.print System.out System System.out " " + Room[l][j][k] " " Room[l][j][k] Room[l][j] Room[l] Room l j k System.out.println("") System.out.println System.out System System.out "" if(l != 3) {
                 		System.out.println("####################");
                	} l != 3 l 3 {
                 		System.out.println("####################");
                	} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.io.*;
class Main{
	public static void main(String[] args)  throws IOException{ 
		int[][][] Room = new int[4][3][10];
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        	String str = br.readLine();
		int line = Integer.parseInt(str);

		for(int i = 0; i < line; i++) {
 
			String str2 = br.readLine();
        	        String[] str3 = str2.split(" ");
 
                	int Building = Integer.parseInt(str3[0]);
                	int Floor = Integer.parseInt(str3[1]);
                	int RoomFirst = Integer.parseInt(str3[2]);
                	int People = Integer.parseInt(str3[3]);
 
                	Room[Building -1][Floor -1][RoomFirst -1] += People;
           	}
 
 	        for(int l = 0; l < 4; l++) {
                	for(int j = 0; j < 3; j++) {
                    		for(int k = 0; k < 10; k++) {
                        		System.out.print(" " + Room[l][j][k]);
                    		}
                    		System.out.println("");                   
                	}
                	if(l != 3) {
                 		System.out.println("####################");
                	}
		}
	}
}