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

public class Main {
	public static void main(String[] args) throws IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	} main {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	} int[][][] ninzu = new int[4][3][10]; ninzu new int[4][3][10] 4 3 10 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 for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		} {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		} String line = br.readLine(); line br.readLine() br.readLine br String[] token = line.split(" "); token line.split(" ") line.split line " " int b b f f r r v; v b = Integer.parseInt(token[0]) b Integer.parseInt(token[0]) Integer.parseInt Integer token[0] token 0 f = Integer.parseInt(token[1]) f Integer.parseInt(token[1]) Integer.parseInt Integer token[1] token 1 r = Integer.parseInt(token[2]) r Integer.parseInt(token[2]) Integer.parseInt Integer token[2] token 2 v = Integer.parseInt(token[3]) v Integer.parseInt(token[3]) Integer.parseInt Integer token[3] token 3 ninzu[b - 1][f - 1][r - 1] += v ninzu[b - 1][f - 1][r - 1] ninzu[b - 1][f - 1] ninzu[b - 1] ninzu b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + ninzu[i][j][k]);
				} {
					System.out.print(" " + ninzu[i][j][k]);
				} System.out.print(" " + ninzu[i][j][k]) System.out.print System.out System System.out " " + ninzu[i][j][k] " " ninzu[i][j][k] ninzu[i][j] ninzu[i] ninzu i j k System.out.println() System.out.println System.out System System.out if (i != 3) {
				System.out.println("####################");
			} i != 3 i 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 IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		int[][][] ninzu = new int[4][3][10];
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String line = br.readLine();
			String[] token = line.split(" ");
			int b, f, r, v;
			b = Integer.parseInt(token[0]);
			f = Integer.parseInt(token[1]);
			r = Integer.parseInt(token[2]);
			v = Integer.parseInt(token[3]);
			ninzu[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + ninzu[i][j][k]);
				}
				System.out.println();
			}
			if (i != 3) {
				System.out.println("####################");
			}
		}
	}
}