import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  n									//入力件数
			,b									//棟
			,f									//階
			,r									//部屋
			,v;									//入居者
		int[][][] house = new int[4][3][10]; 	
			
		try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		String[] input = new String[n];
		String output = "";
		
		for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		}
		
		//出力
		for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		}
		
	}
}
 import java.io.*; io.* java import java.io.IOException; IOException java.io class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  n									//入力件数
			,b									//棟
			,f									//階
			,r									//部屋
			,v;									//入居者
		int[][][] house = new int[4][3][10]; 	
			
		try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		String[] input = new String[n];
		String output = "";
		
		for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		}
		
		//出力
		for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		}
		
	}
} Main public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  n									//入力件数
			,b									//棟
			,f									//階
			,r									//部屋
			,v;									//入居者
		int[][][] house = new int[4][3][10]; 	
			
		try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		String[] input = new String[n];
		String output = "";
		
		for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		}
		
		//出力
		for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		}
		
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  n									//入力件数
			,b									//棟
			,f									//階
			,r									//部屋
			,v;									//入居者
		int[][][] house = new int[4][3][10]; 	
			
		try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		String[] input = new String[n];
		String output = "";
		
		for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		}
		
		//出力
		for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		}
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int  n n b b f f r r v; v int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		} catch(IOException e){
			System.out.println(e);
			return;
		} IOException e {
			System.out.println(e);
			return;
		} System.out.println(e) System.out.println System.out System System.out e return; {
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		} n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] input = new String[n]; input new String[n] n String output = ""; output "" for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		} {
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		} try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			} catch(IOException e){
				System.out.println(e);
				return;
			} IOException e {
				System.out.println(e);
				return;
			} System.out.println(e) System.out.println System.out System System.out e return; {
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			} input = br.readLine().split("[\\s]+") input br.readLine().split("[\\s]+") br.readLine().split br.readLine() br.readLine br "[\\s]+" b = Integer.parseInt(input[0]) b Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 f = Integer.parseInt(input[1]) f Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 r = Integer.parseInt(input[2]) r Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 v = Integer.parseInt(input[3]) v Integer.parseInt(input[3]) Integer.parseInt Integer input[3] input 3 house[b-1][f-1][r-1] += v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 1 v for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		} b=0; b=0 b 0 b<4 b 4 b++ b++ b {
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		} {
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		} for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			} f=0; f=0 f 0 f<3 f 3 f++ f++ f {
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			} {
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			} for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				} r=0; r=0 r 0 r<10 r 10 r++ r++ r {
					output += " " + house[b][f][r];
				} {
					output += " " + house[b][f][r];
				} output += " " + house[b][f][r] output " " + house[b][f][r] " " house[b][f][r] house[b][f] house[b] house b f r System.out.println(output) System.out.println System.out System System.out output output = "" output "" if(b<3)System.out.println("####################"); b<3 b 3 System.out.println("####################") System.out.println System.out System System.out "####################" String args[] args
import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int  n									//入力件数
			,b									//棟
			,f									//階
			,r									//部屋
			,v;									//入居者
		int[][][] house = new int[4][3][10]; 	
			
		try{
			//入力件数の入力
			n = Integer.parseInt(br.readLine());
		}catch(IOException e){
			System.out.println(e);
			return;
		}
		
		String[] input = new String[n];
		String output = "";
		
		for(int i=0;i<n;i++){
			try{
				//各情報の入力
				input = br.readLine().split("[\\s]+");
				b = Integer.parseInt(input[0]);
				f = Integer.parseInt(input[1]);
				r = Integer.parseInt(input[2]);
				v = Integer.parseInt(input[3]);
				
				house[b-1][f-1][r-1] += v;
				
			}catch(IOException e){
				System.out.println(e);
				return;
			}
		}
		
		//出力
		for(b=0;b<4;b++){
			for(f=0;f<3;f++){
				for(r=0;r<10;r++){
					output += " " + house[b][f][r];
				}
				System.out.println(output);
				output = "";
			}
			if(b<3)System.out.println("####################");
		}
		
	}
}

