import java.io.*;

public class Main{
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	}

} import java.io.*; io.* java public class Main{
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	}

} Main public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	} main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int p p b b f f r r v; v int room[][]=new int[13][11]; room new int[13][11] 13 11 String str=br.readLine(); str br.readLine() br.readLine br if(str.equals("")) System.exit(0); str.equals("") str.equals str "" System.exit(0) System.exit System 0 int n=Integer.parseInt(str); n Integer.parseInt(str) Integer.parseInt Integer str String[] strArray; strArray for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		} {
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		} str=br.readLine() str br.readLine() br.readLine br strArray=str.split(" ") strArray str.split(" ") str.split str " " b=Integer.parseInt(strArray[0]) b Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 f=Integer.parseInt(strArray[1]) f Integer.parseInt(strArray[1]) Integer.parseInt Integer strArray[1] strArray 1 r=Integer.parseInt(strArray[2]) r Integer.parseInt(strArray[2]) Integer.parseInt Integer strArray[2] strArray 2 v=Integer.parseInt(strArray[3]) v Integer.parseInt(strArray[3]) Integer.parseInt Integer strArray[3] strArray 3 room[(b-1)*3+f][r]+=v room[(b-1)*3+f][r] room[(b-1)*3+f] room (b-1)*3+f (b-1)*3 (b-1) b 1 3 f r v StringBuilder output = new StringBuilder(); output new StringBuilder() boolean div =false; div false for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		} int i=1; int i=1; i 1 i<=12 i 12 i++ i++ i {
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		} {
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		} p=1 p 1 while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			} p<=10 p 10 {
				output.append(" "+ room[i][p]);
				p++;
			} output.append(" "+ room[i][p]) output.append output " "+ room[i][p] " " room[i][p] room[i] room i p p++ p output.append("\n") output.append output "\n" switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			} i case 3: 3 case 3: div=true div true break; case 6: 6 case 6: div=true div true break; case 9: 9 case 9: div=true div true break; default: default: div=false div false break; if(div==true){
				output.append("####################\n");
				div=false;} div==true div true {
				output.append("####################\n");
				div=false;} output.append("####################\n") output.append output "####################\n" div=false div false output.delete(output.length()-1,output.length()) output.delete output output.length()-1 output.length() output.length output 1 output.length() output.length output System.out.println(output) System.out.println System.out System System.out output String[] arg arg public class Main{
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	}

} public class Main{
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	}

} Main
import java.io.*;

public class Main{
    public static void main(String[] arg)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int p,b,f,r,v;
		int room[][]=new int[13][11];

		String str=br.readLine();
		if(str.equals("")) System.exit(0);
		int n=Integer.parseInt(str);
	
		String[] strArray;  
		//Arrays.fill(room,0); //room[][]に初期値0を設定
		
		for(int i=1;i<=n;i++){
			str=br.readLine();
			strArray=str.split(" ");
			b=Integer.parseInt(strArray[0]);
			f=Integer.parseInt(strArray[1]);
			r=Integer.parseInt(strArray[2]);
			v=Integer.parseInt(strArray[3]);
			
			
			room[(b-1)*3+f][r]+=v;
		}
        StringBuilder output = new StringBuilder();
		//出力
        boolean div =false;
 		for (int i=1;i<=12;i++){
			p=1;
			while (p<=10){
				output.append(" "+ room[i][p]);
				p++;
			}
			output.append("\n");
			switch (i){
				case 3:	
					div=true;
					break;
				case 6:
					div=true;
					break;
				case 9:
					div=true;
					break;
				default:div=false;
				break;
			}
			
			if(div==true){
				output.append("####################\n");
				div=false;}
			
		}
 		output.delete(output.length()-1,output.length());
		System.out.println(output);
	}

}