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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.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 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		}
		System.out.print(sb);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		}
		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.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 N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][][] all = new int[4][3][10]; all new int[4][3][10] 4 3 10 for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		} int l = 0; int l = 0; l 0 l<N l N l++ l++ l {
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		} {
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		} String[] set = br.readLine().split(" "); set br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(set[0]); b Integer.parseInt(set[0]) Integer.parseInt Integer set[0] set 0 int f = Integer.parseInt(set[1]); f Integer.parseInt(set[1]) Integer.parseInt Integer set[1] set 1 int r = Integer.parseInt(set[2]); r Integer.parseInt(set[2]) Integer.parseInt Integer set[2] set 2 int v = Integer.parseInt(set[3]); v Integer.parseInt(set[3]) Integer.parseInt Integer set[3] set 3 all[b-1][f-1][r-1] += v all[b-1][f-1][r-1] all[b-1][f-1] all[b-1] all b-1 b 1 f-1 f 1 r-1 r 1 v for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		} int i = 0; int i = 0; i 0 i < all.length i all.length all all.length i++ i++ i {
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		} {
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		} for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			} int j = 0; int j = 0; j 0 j < all[i].length j all[i].length all[i] all i all[i].length j++ j++ j {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			} {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			} for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				} int k = 0; int k = 0; k 0 k < all[i][j].length k all[i][j].length all[i][j] all[i] all i j all[i][j].length k++ k++ k {
					sb.append(" ").append(all[i][j][k]);
				} {
					sb.append(" ").append(all[i][j][k]);
				} sb.append(" ").append(all[i][j][k]) sb.append(" ").append sb.append(" ") sb.append sb " " all[i][j][k] all[i][j] all[i] all i j k sb.append("\n") sb.append sb "\n" if (i != all[i].length) {
				sb.append("####################\n");
			} i != all[i].length i all[i].length all[i] all i all[i].length {
				sb.append("####################\n");
			} sb.append("####################\n") sb.append sb "####################\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		}
		System.out.print(sb);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		}
		System.out.print(sb);
	}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int N = Integer.parseInt(br.readLine());
		int[][][] all = new int[4][3][10];

		for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0]);
			int f = Integer.parseInt(set[1]);
			int r = Integer.parseInt(set[2]);
			int v = Integer.parseInt(set[3]);

			all[b-1][f-1][r-1] += v;
		}

		for(int i = 0; i < all.length; i++){
			for(int j = 0; j < all[i].length; j++) {
				for(int k = 0; k < all[i][j].length; k++) {
					sb.append(" ").append(all[i][j][k]);
				}
				sb.append("\n");
			}
			if (i != all[i].length) {
				sb.append("####################\n");
			}
		}
		System.out.print(sb);
	}

}