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

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	}
} import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][] k_1 = new int[3][10]; k_1 new int[3][10] 3 10 int[][] k_2 = new int[3][10]; k_2 new int[3][10] 3 10 int[][] k_3 = new int[3][10]; k_3 new int[3][10] 3 10 int[][] k_4 = new int[3][10]; k_4 new int[3][10] 3 10 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		} {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		} String[] strAry = br.readLine().split(" "); strAry br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			} strAry[0] strAry 0 case "1": "1" case "1": k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]) k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] k_1[Integer.parseInt(strAry[1]) - 1] k_1 Integer.parseInt(strAry[1]) - 1 Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 1 Integer.parseInt(strAry[2]) - 1 Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 2 1 Integer.parseInt(strAry[3]) Integer.parseInt Integer strAry[3] strAry 3 break; case "2": "2" case "2": k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]) k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] k_2[Integer.parseInt(strAry[1]) - 1] k_2 Integer.parseInt(strAry[1]) - 1 Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 1 Integer.parseInt(strAry[2]) - 1 Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 2 1 Integer.parseInt(strAry[3]) Integer.parseInt Integer strAry[3] strAry 3 break; case "3": "3" case "3": k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]) k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] k_3[Integer.parseInt(strAry[1]) - 1] k_3 Integer.parseInt(strAry[1]) - 1 Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 1 Integer.parseInt(strAry[2]) - 1 Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 2 1 Integer.parseInt(strAry[3]) Integer.parseInt Integer strAry[3] strAry 3 break; case "4": "4" case "4": k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]) k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] k_4[Integer.parseInt(strAry[1]) - 1] k_4 Integer.parseInt(strAry[1]) - 1 Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 1 Integer.parseInt(strAry[2]) - 1 Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 2 1 Integer.parseInt(strAry[3]) Integer.parseInt Integer strAry[3] strAry 3 break; for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		} {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		} for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			} {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			} if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]); j == 9 j 9 System.out.println(" " + k_1[i][j]) System.out.println System.out System System.out " " + k_1[i][j] " " k_1[i][j] k_1[i] k_1 i j System.out.print(" " + k_1[i][j]) System.out.print System.out System System.out " " + k_1[i][j] " " k_1[i][j] k_1[i] k_1 i j System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		} {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		} for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			} {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			} if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]); j == 9 j 9 System.out.println(" " + k_2[i][j]) System.out.println System.out System System.out " " + k_2[i][j] " " k_2[i][j] k_2[i] k_2 i j System.out.print(" " + k_2[i][j]) System.out.print System.out System System.out " " + k_2[i][j] " " k_2[i][j] k_2[i] k_2 i j System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		} {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		} for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			} {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			} if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]); j == 9 j 9 System.out.println(" " + k_3[i][j]) System.out.println System.out System System.out " " + k_3[i][j] " " k_3[i][j] k_3[i] k_3 i j System.out.print(" " + k_3[i][j]) System.out.print System.out System System.out " " + k_3[i][j] " " k_3[i][j] k_3[i] k_3 i j System.out.println("####################") System.out.println System.out System System.out "####################" for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		} {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		} for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			} {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			} if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]); i == 3 && j == 9 i == 3 i 3 j == 9 j 9 System.out.print(" " + k_4[i][j]) System.out.print System.out System System.out " " + k_4[i][j] " " k_4[i][j] k_4[i] k_4 i j if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]); j == 9 j 9 System.out.println(" " + k_4[i][j]) System.out.println System.out System System.out " " + k_4[i][j] " " k_4[i][j] k_4[i] k_4 i j System.out.print(" " + k_4[i][j]) System.out.print System.out System System.out " " + k_4[i][j] " " k_4[i][j] k_4[i] k_4 i j String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	}
} Main
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
		int[][] k_1 = new int[3][10];
		int[][] k_2 = new int[3][10];
		int[][] k_3 = new int[3][10];
		int[][] k_4 = new int[3][10];
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String[] strAry = br.readLine().split(" ");
			switch (strAry[0]) {
			case "1":
				k_1[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "2":
				k_2[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "3":
				k_3[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			case "4":
				k_4[Integer.parseInt(strAry[1]) - 1][Integer.parseInt(strAry[2]) - 1] += Integer.parseInt(strAry[3]);
				break;
			}
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_1[i][j]);
				else System.out.print(" " + k_1[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_2[i][j]);
				else System.out.print(" " + k_2[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (j == 9) System.out.println(" " + k_3[i][j]);
				else System.out.print(" " + k_3[i][j]);
			}
		}
		System.out.println("####################");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == 3 && j == 9)  System.out.print(" " + k_4[i][j]);
				else if (j == 9) System.out.println(" " + k_4[i][j]);
				else System.out.print(" " + k_4[i][j]);
			}
		}
	}
}