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

public class Main {

	private static final int B = 4;
	private static final int F = 3;
	private static final int R = 10;

	public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	private static final int B = 4;
	private static final int F = 3;
	private static final int R = 10;

	public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	}

} Main private static final int B = 4; B 4 private static final int F = 3; F 3 private static final int R = 10; R 10 public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int[][][] residence = new int[B][F][R]; residence new int[B][F][R] B F R 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[] str = br.readLine().split(" ");
			int b = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			int v = Integer.parseInt(str[3]);
			residence[b - 1][f - 1][r - 1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] str = br.readLine().split(" ");
			int b = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			int v = Integer.parseInt(str[3]);
			residence[b - 1][f - 1][r - 1] += v;
		} {
			String[] str = br.readLine().split(" ");
			int b = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			int v = Integer.parseInt(str[3]);
			residence[b - 1][f - 1][r - 1] += v;
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(str[0]); b Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int f = Integer.parseInt(str[1]); f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int r = Integer.parseInt(str[2]); r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int v = Integer.parseInt(str[3]); v Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 residence[b - 1][f - 1][r - 1] += v residence[b - 1][f - 1][r - 1] residence[b - 1][f - 1] residence[b - 1] residence b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		} int i = 0; int i = 0; i 0 i < B i B i++ i++ i {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		} {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		} for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			} int j = 0; int j = 0; j 0 j < F j F j++ j++ j {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			} {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			} for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				} int k = 0; int k = 0; k 0 k < R k R k++ k++ k {
					sb.append(" ").append(residence[i][j][k]);
				} {
					sb.append(" ").append(residence[i][j][k]);
				} sb.append(" ").append(residence[i][j][k]) sb.append(" ").append sb.append(" ") sb.append sb " " residence[i][j][k] residence[i][j] residence[i] residence i j k sb.append("\n") sb.append sb "\n" if (i != B - 1) {
				sb.append("####################").append("\n");
			} i != B - 1 i B - 1 B 1 {
				sb.append("####################").append("\n");
			} sb.append("####################").append("\n") sb.append("####################").append sb.append("####################") sb.append sb "####################" "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {

	private static final int B = 4;
	private static final int F = 3;
	private static final int R = 10;

	public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	}

} public class Main {

	private static final int B = 4;
	private static final int F = 3;
	private static final int R = 10;

	public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	}

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

public class Main {

	private static final int B = 4;
	private static final int F = 3;
	private static final int R = 10;

	public static void main(String[] args) throws  IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[B][F][R];

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

		for (int i = 0; i < B; i++) {
			for (int j = 0; j < F; j++) {
				for (int k = 0; k < R; k++) {
					sb.append(" ").append(residence[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != B - 1) {
				sb.append("####################").append("\n");
			}
		}

		System.out.print(sb);
	}

}