import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		
		int[][][] houseInfo = new int[4][3][10];	// ?£?/????????¢/??¨?±? number
		
		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		}

		for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		}
	}
} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		
		int[][][] houseInfo = new int[4][3][10];	// ?£?/????????¢/??¨?±? number
		
		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		}

		for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		}
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		
		int[][][] houseInfo = new int[4][3][10];	// ?£?/????????¢/??¨?±? number
		
		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		}

		for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		}
	} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		
		int[][][] houseInfo = new int[4][3][10];	// ?£?/????????¢/??¨?±? number
		
		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		}

		for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][][] houseInfo = new int[4][3][10]; houseInfo new int[4][3][10] 4 3 10 for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		} {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc houseInfo[b-1][f-1][r-1] += v houseInfo[b-1][f-1][r-1] houseInfo[b-1][f-1] houseInfo[b-1] houseInfo b-1 b 1 f-1 f 1 r-1 r 1 v for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		} int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		} {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		} int[][] bInfo = houseInfo[b]; bInfo houseInfo[b] houseInfo b for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			} int[] fInfo bInfo {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			} {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			} for(int h : fInfo) {
					System.out.print(" " + h);
				} int h fInfo {
					System.out.print(" " + h);
				} {
					System.out.print(" " + h);
				} System.out.print(" " + h) System.out.print System.out System System.out " " + h " " h System.out.println() System.out.println System.out System System.out if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			} b != 3 b 3 {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			} for (int i = 0; i < 20; i++) {
					System.out.print("#");
				} int i = 0; int i = 0; i 0 i < 20 i 20 i++ i++ i {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print System.out System System.out "#" 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 sc = new Scanner(System.in);

		int n = sc.nextInt();
		
		int[][][] houseInfo = new int[4][3][10];	// ?£?/????????¢/??¨?±? number
		
		for (int i = 0; i < n; i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int v = sc.nextInt();
		
			houseInfo[b-1][f-1][r-1] += v;
		}

		for(int b = 0; b < 4; b++) {
			int[][] bInfo = houseInfo[b];
			
			for(int[] fInfo : bInfo) {
				for(int h : fInfo) {
					System.out.print(" " + h);
				}
				System.out.println();
			}
			
			if(b != 3) {
				for (int i = 0; i < 20; i++) {
					System.out.print("#");
				}
				System.out.println();
			}
		}
	}
}