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));
		int N = Integer.parseInt(br.readLine());

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	}

} 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));
		int N = Integer.parseInt(br.readLine());

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	}

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

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	} 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 int[][] ground = new int[3][10]; ground new int[3][10] 3 10 int[][] second = new int[3][10]; second new int[3][10] 3 10 int[][] third = new int[3][10]; third new int[3][10] 3 10 int[][] forth = new int[3][10]; forth new int[3][10] 3 10 int[][][] all = {ground,second,third,forth}; all {ground,second,third,forth} ground second third forth for(int l = 0; l<N; l++){
			String[] set = br.readLine().split(" ");
			int b = Integer.parseInt(set[0])-1;
			int f = Integer.parseInt(set[1])-1;
			int r = Integer.parseInt(set[2])-1;
			int v = Integer.parseInt(set[3]);

			all[b][f][r] += 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])-1;
			int f = Integer.parseInt(set[1])-1;
			int r = Integer.parseInt(set[2])-1;
			int v = Integer.parseInt(set[3]);

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

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

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

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	}

} public class Main {

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

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	}

} 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));
		int N = Integer.parseInt(br.readLine());

		int[][] ground = new int[3][10];
		int[][] second = new int[3][10];
		int[][] third = new int[3][10];
		int[][] forth = new int[3][10];

		int[][][] all = {ground,second,third,forth};

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

			all[b][f][r] += 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++) {
					System.out.print(" " + all[i][j][k]);
				}
				System.out.print("\n");
			}
			if (i != 3) {
				System.out.print("####################\n");
			}
		}

	}

}