import java.util.*;

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

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

