import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		int i,j,k;
		int b,f,r,v;
		
		int house[][][];
		house = new int[4][3][10];
		String str;
		
		for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		}
		
		for(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		}

	}

} import java.util.Scanner; Scanner java.util class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		int i,j,k;
		int b,f,r,v;
		
		int house[][][];
		house = new int[4][3][10];
		String str;
		
		for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		}
		
		for(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		}

	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		int i,j,k;
		int b,f,r,v;
		
		int house[][][];
		house = new int[4][3][10];
		String str;
		
		for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		}
		
		for(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		}

	} main {
		// TODO Auto-generated method stub
		
Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		int i,j,k;
		int b,f,r,v;
		
		int house[][][];
		house = new int[4][3][10];
		String str;
		
		for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		}
		
		for(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		}

	} Scanner as = new Scanner(System.in); as new Scanner(System.in) int n=as.nextInt(); n as.nextInt() as.nextInt as int i i j j k; k int b b f f r r v; v int house[][][]; house house = new int[4][3][10] house new int[4][3][10] 4 3 10 String str; str for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		} {
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		} b=as.nextInt() b as.nextInt() as.nextInt as f=as.nextInt() f as.nextInt() as.nextInt as r=as.nextInt() r as.nextInt() as.nextInt as v=as.nextInt() v as.nextInt() as.nextInt as house[b-1][f-1][r-1]=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 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(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		} i=0; i=0 i 0 i<4 i 4 i++ i++ i {
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		} {
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		} for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			} j=0; j=0 j 0 j<3 j 3 j++ j++ j {
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			} {
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			} for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				} k=0; k=0 k 0 k<10 k 10 k++ k++ k {
					str=" "+house[i][j][k];
					System.out.print(str);
				} {
					str=" "+house[i][j][k];
					System.out.print(str);
				} str=" "+house[i][j][k] str " "+house[i][j][k] " " house[i][j][k] house[i][j] house[i] house i j k System.out.print(str) System.out.print System.out System System.out str System.out.println() System.out.println System.out System System.out if(i != 3){
				str="####################";
				System.out.println(str);
			} i != 3 i 3 {
				str="####################";
				System.out.println(str);
			} str="####################" str "####################" System.out.println(str) System.out.println System.out System System.out str String[] args args
import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
Scanner as = new Scanner(System.in);
		
		int n=as.nextInt();
		int i,j,k;
		int b,f,r,v;
		
		int house[][][];
		house = new int[4][3][10];
		String str;
		
		for(i=0;i<n;i++){
			
			b=as.nextInt();
			f=as.nextInt();
			r=as.nextInt();
			v=as.nextInt();
			house[b-1][f-1][r-1]=house[b-1][f-1][r-1]+v;
			
		}
		
		for(i=0;i<4;i++){
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					str=" "+house[i][j][k];
					System.out.print(str);
				}
				System.out.println();
			}
			if(i != 3){
				str="####################";
				System.out.println(str);
			}
		}

	}

}