import java.util.Scanner;

class Main {

	public static void main(String args[]){	
		Scanner scan = new Scanner(System.in);

		int n, b, f, r, v;
		
		n = scan.nextInt();
		
		int a[][][];
		a = new int[10][3][4];
		
		for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		}
		
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		}
	}	
} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String args[]){	
		Scanner scan = new Scanner(System.in);

		int n, b, f, r, v;
		
		n = scan.nextInt();
		
		int a[][][];
		a = new int[10][3][4];
		
		for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		}
		
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		}
	}	
} Main public static void main(String args[]){	
		Scanner scan = new Scanner(System.in);

		int n, b, f, r, v;
		
		n = scan.nextInt();
		
		int a[][][];
		a = new int[10][3][4];
		
		for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		}
		
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		}
	} main {	
		Scanner scan = new Scanner(System.in);

		int n, b, f, r, v;
		
		n = scan.nextInt();
		
		int a[][][];
		a = new int[10][3][4];
		
		for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		}
		
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n n b b f f r r v; v n = scan.nextInt() n scan.nextInt() scan.nextInt scan int a[][][]; a a = new int[10][3][4] a new int[10][3][4] 10 3 4 for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		} {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			} r <= 10 && f <= 3 && b <= 4 r <= 10 && f <= 3 && b <= 4 r <= 10 r 10 f <= 3 f 3 b <= 4 b 4 {
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			} a[r-1][f-1][b-1] += v a[r-1][f-1][b-1] a[r-1][f-1] a[r-1] a r-1 r 1 f-1 f 1 b-1 b 1 v if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				} a[r-1][f-1][b-1] > 9 a[r-1][f-1][b-1] a[r-1][f-1] a[r-1] a r-1 r 1 f-1 f 1 b-1 b 1 9 {
					a[r-1][f-1][b-1] = 9;
				} a[r-1][f-1][b-1] = 9 a[r-1][f-1][b-1] a[r-1][f-1] a[r-1] a r-1 r 1 f-1 f 1 b-1 b 1 9 if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				} a[r-1][f-1][b-1] < 0 a[r-1][f-1][b-1] a[r-1][f-1] a[r-1] a r-1 r 1 f-1 f 1 b-1 b 1 0 {
					a[r-1][f-1][b-1] = 0;
				} a[r-1][f-1][b-1] = 0 a[r-1][f-1][b-1] a[r-1][f-1] a[r-1] a r-1 r 1 f-1 f 1 b-1 b 1 0 for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		} int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		} {
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		} for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			} int k = 0; int k = 0; k 0 k < 3 k 3 k++ k++ k {
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			} {
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			} for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				} int l = 0; int l = 0; l 0 l < 10 l 10 l++ l++ l {
					System.out.print(" " + a[l][k][j]);
				} {
					System.out.print(" " + a[l][k][j]);
				} System.out.print(" " + a[l][k][j]) System.out.print System.out System System.out " " + a[l][k][j] " " a[l][k][j] a[l][k] a[l] a l k j System.out.println() System.out.println System.out System System.out if(j != 3){
				System.out.println("####################");
			} j != 3 j 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String args[] args
import java.util.Scanner;

class Main {

	public static void main(String args[]){	
		Scanner scan = new Scanner(System.in);

		int n, b, f, r, v;
		
		n = scan.nextInt();
		
		int a[][][];
		a = new int[10][3][4];
		
		for(int i = 0;i < n;i++){
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			if(r <= 10 && f <= 3 && b <= 4){
				a[r-1][f-1][b-1] += v;
				if(a[r-1][f-1][b-1] > 9){
					a[r-1][f-1][b-1] = 9;
				}
				if(a[r-1][f-1][b-1] < 0){
					a[r-1][f-1][b-1] = 0;
				}
			}
		}
		
		for(int j = 0; j < 4; j++){
			for(int k = 0; k < 3; k++){
				for(int l = 0; l < 10; l++){
					System.out.print(" " + a[l][k][j]);
				}
				System.out.println();
			}
			if(j != 3){
				System.out.println("####################");
			}
		}
	}	
}