import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] b = new int[n]; b new int[n] n int[] f = new int[n]; f new int[n] n int[] r = new int[n]; r new int[n] n int[] v = new int[n]; v new int[n] n int[][][] num = new int[4][3][10]; num new int[4][3][10] 4 3 10 for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

			num[b[i] - 1][f[i] - 1][r[i] - 1] += v[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

			num[b[i] - 1][f[i] - 1][r[i] - 1] += v[i];
		} {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

			num[b[i] - 1][f[i] - 1][r[i] - 1] += v[i];
		} b[i] = scan.nextInt() b[i] b i scan.nextInt() scan.nextInt scan f[i] = scan.nextInt() f[i] f i scan.nextInt() scan.nextInt scan r[i] = scan.nextInt() r[i] r i scan.nextInt() scan.nextInt scan v[i] = scan.nextInt() v[i] v i scan.nextInt() scan.nextInt scan num[b[i] - 1][f[i] - 1][r[i] - 1] += v[i] num[b[i] - 1][f[i] - 1][r[i] - 1] num[b[i] - 1][f[i] - 1] num[b[i] - 1] num b[i] - 1 b[i] b i 1 f[i] - 1 f[i] f i 1 r[i] - 1 r[i] r i 1 v[i] v i for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			}
			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++) {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} {
			for (int j = 0; j < 3; j++) {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			}
			if (i != 3) {
				System.out.println("####################");
			}
		} for (int j = 0; j < 3; j++) {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			} {
				String str = "";
				for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				}
				System.out.println(str);
			} String str = ""; str "" for (int k = 0; k < 10; k++) {
					str += " " + num[i][j][k]; 
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					str += " " + num[i][j][k]; 
				} {
					str += " " + num[i][j][k]; 
				} str += " " + num[i][j][k] str " " + num[i][j][k] " " num[i][j][k] num[i][j] num[i] num i j k System.out.println(str) System.out.println System.out System System.out str if (i != 3) {
				System.out.println("####################");
			} i != 3 i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		int[][][] num = new int[4][3][10];

		for (int i = 0; i < n; i++) {
			b[i] = scan.nextInt();
			f[i] = scan.nextInt();
			r[i] = scan.nextInt();
			v[i] = scan.nextInt();

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

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

		scan.close();
	}

}