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[][][] residence = new int[4][3][10];

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

		}
	}
}
// for (int i=0;i<4;i++){
// for(int j=0;j<3;j++){
// for (int k=0;k<10;k++){
// sb.append(" ").append(residence[i][j][k]);
// }
// sb.("\n");
// }
// if (i !=4){
// System.out.print("##########");
// } 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[][][] residence = new int[4][3][10];

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

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

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[4][3][10];

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

		}
	} 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[4][3][10]; residence new int[4][3][10] 4 3 10 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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			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(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

		} {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

		} for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			} 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(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			} {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			} for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + residence[i][j][k] );

				} {
					System.out.print(" " + residence[i][j][k] );

				} System.out.print(" " + residence[i][j][k] ) System.out.print System.out System System.out " " + residence[i][j][k] " " residence[i][j][k] residence[i][j] residence[i] residence i j k System.out.print("\n") System.out.print System.out System System.out "\n" 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 {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[4][3][10];

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

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

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			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 {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] residence = new int[4][3][10];

		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 < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					System.out.print(" " + residence[i][j][k] );

				}
				System.out.print("\n");
			}
			
			if (i != 3) {
				System.out.println("####################");
			}

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