import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	} main {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][] house1 = new int[3][10]; house1 new int[3][10] 3 10 int[][] house2 = new int[3][10]; house2 new int[3][10] 3 10 int[][] house3 = new int[3][10]; house3 new int[3][10] 3 10 int[][] house4 = new int[3][10]; house4 new int[3][10] 3 10 StringBuilder output = new StringBuilder(); output new StringBuilder() for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		} {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		} for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			} {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			} house1[i][j] = 0 house1[i][j] house1[i] house1 i j 0 house2[i][j] = 0 house2[i][j] house2[i] house2 i j 0 house3[i][j] = 0 house3[i][j] house3[i] house3 i j 0 house4[i][j] = 0 house4[i][j] house4[i] house4 i j 0 int infonum = scan.nextInt(); infonum scan.nextInt() scan.nextInt scan for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		} int i = 0; int i = 0; i 0 i < infonum i infonum i++ i++ i {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		} {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		} int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan if (b == 1) {
				house1[f-1][r-1] += v;
			} b == 1 b 1 {
				house1[f-1][r-1] += v;
			} house1[f-1][r-1] += v house1[f-1][r-1] house1[f-1] house1 f-1 f 1 r-1 r 1 v if (b == 2) {
				house2[f-1][r-1] += v;
			} b == 2 b 2 {
				house2[f-1][r-1] += v;
			} house2[f-1][r-1] += v house2[f-1][r-1] house2[f-1] house2 f-1 f 1 r-1 r 1 v if (b == 3) {
				house3[f-1][r-1] += v;
			} b == 3 b 3 {
				house3[f-1][r-1] += v;
			} house3[f-1][r-1] += v house3[f-1][r-1] house3[f-1] house3 f-1 f 1 r-1 r 1 v if (b == 4) {
				house4[f-1][r-1] += v;
			} b == 4 b 4 {
				house4[f-1][r-1] += v;
			} house4[f-1][r-1] += v house4[f-1][r-1] house4[f-1] house4 f-1 f 1 r-1 r 1 v for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		} {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		} for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				output.append(" ").append(house1[i][j]);
			} {
				output.append(" ").append(house1[i][j]);
			} output.append(" ").append(house1[i][j]) output.append(" ").append output.append(" ") output.append output " " house1[i][j] house1[i] house1 i j output.append('\n') output.append output '\n' output.append("####################").append('\n') output.append("####################").append output.append("####################") output.append output "####################" '\n' for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		} {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		} for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				output.append(" ").append(house2[i][j]);
			} {
				output.append(" ").append(house2[i][j]);
			} output.append(" ").append(house2[i][j]) output.append(" ").append output.append(" ") output.append output " " house2[i][j] house2[i] house2 i j output.append('\n') output.append output '\n' output.append("####################").append('\n') output.append("####################").append output.append("####################") output.append output "####################" '\n' for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		} {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		} for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				output.append(" ").append(house3[i][j]);
			} {
				output.append(" ").append(house3[i][j]);
			} output.append(" ").append(house3[i][j]) output.append(" ").append output.append(" ") output.append output " " house3[i][j] house3[i] house3 i j output.append('\n') output.append output '\n' output.append("####################").append('\n') output.append("####################").append output.append("####################") output.append output "####################" '\n' for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		} {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		} for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				output.append(" ").append(house4[i][j]);
			} {
				output.append(" ").append(house4[i][j]);
			} output.append(" ").append(house4[i][j]) output.append(" ").append output.append(" ") output.append output " " house4[i][j] house4[i] house4 i j output.append('\n') output.append output '\n' System.out.print(output) System.out.print System.out System System.out output String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[][] house1 = new int[3][10];
		int[][] house2 = new int[3][10];
		int[][] house3 = new int[3][10];
		int[][] house4 = new int[3][10];
		StringBuilder output = new StringBuilder();
		
		// 入居者数の初期化
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				house1[i][j] = 0;
				house2[i][j] = 0;
				house3[i][j] = 0;
				house4[i][j] = 0;
			}
		}
		
		// 入居者数の更新
		int infonum = scan.nextInt();
		for (int i = 0; i < infonum; i++) {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			if (b == 1) {
				house1[f-1][r-1] += v;
			}
			if (b == 2) {
				house2[f-1][r-1] += v;
			}
			if (b == 3) {
				house3[f-1][r-1] += v;
			}
			if (b == 4) {
				house4[f-1][r-1] += v;
			}
		}
		
		// 出力
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house1[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house2[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house3[i][j]);
			}
			output.append('\n');
		}
		output.append("####################").append('\n');
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 10; j++) {
				output.append(" ").append(house4[i][j]);
			}
			output.append('\n');
		}
		System.out.print(output);
	}

}