import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	}

	private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	}

	private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	}

	private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	}

	private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; tower1 {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}} {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; tower2 {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}} {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; tower3 {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}} {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}}; tower4 {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}} {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 {0,0,0,0,0,0,0,0,0,0} 0 0 0 0 0 0 0 0 0 0 for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		} {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		} int[] line = convertInt(br.readLine().split(" ")); line convertInt(br.readLine().split(" ")) convertInt br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			} line[0] line 0 case 1: 1 case 1: tower1[line[1] - 1][line[2] - 1] += line[3] tower1[line[1] - 1][line[2] - 1] tower1[line[1] - 1] tower1 line[1] - 1 line[1] line 1 1 line[2] - 1 line[2] line 2 1 line[3] line 3 break; case 2: 2 case 2: tower2[line[1] - 1][line[2] - 1] += line[3] tower2[line[1] - 1][line[2] - 1] tower2[line[1] - 1] tower2 line[1] - 1 line[1] line 1 1 line[2] - 1 line[2] line 2 1 line[3] line 3 break; case 3: 3 case 3: tower3[line[1] - 1][line[2] - 1] += line[3] tower3[line[1] - 1][line[2] - 1] tower3[line[1] - 1] tower3 line[1] - 1 line[1] line 1 1 line[2] - 1 line[2] line 2 1 line[3] line 3 break; case 4: 4 case 4: tower4[line[1] - 1][line[2] - 1] += line[3] tower4[line[1] - 1][line[2] - 1] tower4[line[1] - 1] tower4 line[1] - 1 line[1] line 1 1 line[2] - 1 line[2] line 2 1 line[3] line 3 break; print(tower1) print tower1 System.out.println("####################") System.out.println System.out System System.out "####################" print(tower2) print tower2 System.out.println("####################") System.out.println System.out System System.out "####################" print(tower3) print tower3 System.out.println("####################") System.out.println System.out System System.out "####################" print(tower4) print tower4 String[] args args private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	} print {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	} int cnt = 0; cnt 0 for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		} int[] array two_array {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		} {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		} for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			} int i array {
				cnt++;
				System.out.print(" " + i);
			} {
				cnt++;
				System.out.print(" " + i);
			} cnt++ cnt System.out.print(" " + i) System.out.print System.out System System.out " " + i " " i System.out.println("") System.out.println System.out System System.out "" int[][] two_array two_array private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	} convertInt {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	} int len = strArray.length; len strArray.length strArray strArray.length int[] intArray = new int[len]; intArray new int[len] len for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			intArray[i] = Integer.parseInt(strArray[i]);
		} {
			intArray[i] = Integer.parseInt(strArray[i]);
		} intArray[i] = Integer.parseInt(strArray[i]) intArray[i] intArray i Integer.parseInt(strArray[i]) Integer.parseInt Integer strArray[i] strArray i return intArray; intArray String[] strArray strArray public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	}

	private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	}

	private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	}

	private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	}

	private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] tower1 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower2 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower3 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		int[][] tower4 = {{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}};
		for (int i = 0; i < n; i++) {
			int[] line = convertInt(br.readLine().split(" "));
			switch (line[0]) {
				case 1:
					tower1[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 2:
					tower2[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 3:
					tower3[line[1] - 1][line[2] - 1] += line[3];
					break;
				case 4:
					tower4[line[1] - 1][line[2] - 1] += line[3];
					break;
			}
		}
		print(tower1);
		System.out.println("####################");
		print(tower2);
		System.out.println("####################");
		print(tower3);
		System.out.println("####################");
		print(tower4);
	}

	private static void print(int[][] two_array) {
		int cnt = 0;
		for (int[] array : two_array) {
			for (int i : array) {
				cnt++;
				System.out.print(" " + i);
			}
			System.out.println("");
		}
	}

	private static int[] convertInt(String[] strArray) {
		int len = strArray.length;
		int[] intArray = new int[len];
		for (int i = 0; i < len; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}
}