import java.util.Scanner;
//b?£?f??????r???????????¨?±????v??????????????§??\?±???????????????????

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	}
/*3
1 1 3 8
3 2 2 7
4 3 8 1*/

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	}
/*3
1 1 3 8
3 2 2 7
4 3 8 1*/

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	} Scanner kb=new Scanner(System.in); kb new Scanner(System.in) int nowLives[][][]=new int[5][4][10]; nowLives new int[5][4][10] 5 4 10 for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		} {
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		} for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			} int j=0; int j=0; j 0 j<4 j 4 j++ j++ j {
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			} {
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			} for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					nowLives[i][j][k]=0;
				} {
					nowLives[i][j][k]=0;
				} nowLives[i][j][k]=0 nowLives[i][j][k] nowLives[i][j] nowLives[i] nowLives i j k 0 int n=kb.nextInt(); n kb.nextInt() kb.nextInt kb int b b f f r r v; v for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		} {
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		} b=kb.nextInt() b kb.nextInt() kb.nextInt kb f=kb.nextInt() f kb.nextInt() kb.nextInt kb r=kb.nextInt() r kb.nextInt() kb.nextInt kb v=kb.nextInt() v kb.nextInt() kb.nextInt kb nowLives[b-1][f-1][r-1]+=v nowLives[b-1][f-1][r-1] nowLives[b-1][f-1] nowLives[b-1] nowLives b-1 b 1 f-1 f 1 r-1 r 1 v for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		} int k=0; int k=0; k 0 k<4 k 4 k++ k++ k {
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		} {
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		} for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		} for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			} {
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			} System.out.printf(" %d",nowLives[k][i][j]) System.out.printf System.out System System.out " %d" nowLives[k][i][j] nowLives[k][i] nowLives[k] nowLives k i j System.out.println() System.out.println System.out System System.out if(k!=3){
		System.out.println("####################");
		} k!=3 k 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) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	}
/*3
1 1 3 8
3 2 2 7
4 3 8 1*/

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	}
/*3
1 1 3 8
3 2 2 7
4 3 8 1*/

} Main
import java.util.Scanner;
//b?£?f??????r???????????¨?±????v??????????????§??\?±???????????????????

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner kb=new Scanner(System.in);
		int nowLives[][][]=new int[5][4][10];
		for(int i=0;i<5;i++){
			for(int j=0;j<4;j++){
				for(int k=0;k<10;k++){
					nowLives[i][j][k]=0;
				}	
			}
		}
		
		int n=kb.nextInt();
		int b,f,r,v;
		for(int i=0;i<n;i++){
		//b?£?f??????r???????????¨?±????v??????????????§??\?±???????
		    b=kb.nextInt();f=kb.nextInt();
            r=kb.nextInt();v=kb.nextInt();
			nowLives[b-1][f-1][r-1]+=v;
		}
		
		
		//System.out.println();
		for(int k=0;k<4;k++){
		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
System.out.printf(" %d",nowLives[k][i][j]);
/*if(j!=9){
	System.out.print(" ");
}*/
			}
			System.out.println();
		}
		if(k!=3){
		System.out.println("####################");
		}
		}
	}
/*3
1 1 3 8
3 2 2 7
4 3 8 1*/

}