import java.util.Scanner;


public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int bd[][][] = new int[4][3][10]; bd new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int i i j j k k b b f f r r v; v for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(b-1)][(f-1)][(r-1)] += v;
			}
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(b-1)][(f-1)][(r-1)] += v;
			}
		} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(b-1)][(f-1)][(r-1)] += v;
			}
		} b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(b-1)][(f-1)][(r-1)] += v;
			} (bd[(b-1)][(f-1)][(r-1)]+v) >= 0 (bd[(b-1)][(f-1)][(r-1)]+v) bd[(b-1)][(f-1)][(r-1)] bd[(b-1)][(f-1)] bd[(b-1)] bd (b-1) b 1 (f-1) f 1 (r-1) r 1 v 0 {
				bd[(b-1)][(f-1)][(r-1)] += v;
			} bd[(b-1)][(f-1)][(r-1)] += v bd[(b-1)][(f-1)][(r-1)] bd[(b-1)][(f-1)] bd[(b-1)] bd (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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		} 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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		} {
			for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		} for(j=0;j<3;j++){
				for(k=0;k<10;k++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			} j=0; j=0 j 0 j<3 j 3 j++ j++ j {
				for(k=0;k<10;k++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			} {
				for(k=0;k<10;k++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			} for(k=0;k<10;k++){
					System.out.print(" "+bd[i][j][k]);
				} k=0; k=0 k 0 k<10 k 10 k++ k++ k {
					System.out.print(" "+bd[i][j][k]);
				} {
					System.out.print(" "+bd[i][j][k]);
				} System.out.print(" "+bd[i][j][k]) System.out.print System.out System System.out " "+bd[i][j][k] " " bd[i][j][k] bd[i][j] bd[i] bd i j k System.out.println() System.out.println System.out System System.out if(i==3){
				break;
			} i==3 i 3 {
				break;
			} break; System.out.println("####################") System.out.println System.out System System.out "####################" sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	}

} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int bd[][][] = new int[4][3][10];
		int n = sc.nextInt();
		int i,j,k,b,f,r,v;
		for(i=0;i<n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			
			if((bd[(b-1)][(f-1)][(r-1)]+v) >= 0){
				bd[(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++){
					System.out.print(" "+bd[i][j][k]);
				}
				System.out.println();
			}
			if(i==3){
				break;
			}
			System.out.println("####################");
		}
		sc.close();
	}

}

