
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	}	
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	}	
} Main public static void main(String[] args) {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	} main {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	} int b b f f r r v v n n x[][][] x i i j = 0 j 0 k; k Scanner sc = new Scanner(System.in); sc new Scanner(System.in) x = new int[5][4][11] x new int[5][4][11] 5 4 11 for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		} j = 0; j = 0 j 0 j < 4 j 4 j++ j++ j {
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		} {
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		} for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			} i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			} {
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			} for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				} k = 0; k = 0 k 0 k < 10 k 10 k++ k++ k {
					x[j][j][k] = 0;
				} {
					x[j][j][k] = 0;
				} x[j][j][k] = 0 x[j][j][k] x[j][j] x[j] x j j k 0 n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			} i = 0; i = 0 i 0 n > i n i i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[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 x[b - 1][f - 1][r - 1] += v x[b - 1][f - 1][r - 1] x[b - 1][f - 1] x[b - 1] x b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		} j = 0; j = 0 j 0 j < 4 j 4 j++ j++ j {
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		} {
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		} for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			} i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			} {
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			} for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				} k = 0; k = 0 k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + x[j][i][k]);
				} {
					System.out.print(" " + x[j][i][k]);
				} System.out.print(" " + x[j][i][k]) System.out.print System.out System System.out " " + x[j][i][k] " " x[j][i][k] x[j][i] x[j] x j i k System.out.print("\n") System.out.print System.out System System.out "\n" if(j != 3)
				System.out.println("####################"); j != 3 j 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
	public static void main(String[] args) {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	}	
} public class Main {
	public static void main(String[] args) {
		int b, f, r, v, n, x[][][], i, j = 0, k;
		Scanner sc = new Scanner(System.in);
		x = new int[5][4][11];
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					x[j][j][k] = 0;
				}
			}
		}
				
		n = sc.nextInt();
		
		for(i = 0; n > i; i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			x[b - 1][f - 1][r - 1] += v;
			}
		
		for(j = 0; j < 4; j++){
			for(i = 0; i < 3; i++){
				for(k = 0; k < 10; k++){
					System.out.print(" " + x[j][i][k]);
				}
				System.out.print("\n");
			}
			if(j != 3)
				System.out.println("####################");
		}
	}	
} Main

import java.util.Scanner;

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