import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	}

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int bmax = 4; bmax 4 int fmax = 3; fmax 3 int rmax = 10; rmax 10 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int b; b int f; f int r; r int v; v int[][][] build = new int[4][3][10]; build new int[4][3][10] 4 3 10 for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		} {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan build[b-1][f-1][r-1] += v build[b-1][f-1][r-1] build[b-1][f-1] build[b-1] build b-1 b 1 f-1 f 1 r-1 r 1 v for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		} int i = 0; int i = 0; i 0 i < bmax i bmax i++ i++ i {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		} {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		} for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < fmax j fmax j++ j++ j {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			} {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			} for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				} int k = 0; int k = 0; k 0 k < rmax k rmax k++ k++ k {
					System.out.print(" " + build[i][j][k]);
				} {
					System.out.print(" " + build[i][j][k]);
				} System.out.print(" " + build[i][j][k]) System.out.print System.out System System.out " " + build[i][j][k] " " build[i][j][k] build[i][j] build[i] build i j k System.out.println() System.out.println System.out System System.out if (i != bmax - 1) System.out.println("####################"); i != bmax - 1 i bmax - 1 bmax 1 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	}

} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int bmax = 4; int fmax = 3; int rmax = 10;
		int n = scan.nextInt();
		int b; int f; int r; int v;
		int[][][] build = new int[4][3][10]; // build[b][f][r]

		for (int i = 0; i < n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			build[b-1][f-1][r-1] += v;
		}
		for (int i = 0; i < bmax; i++) {
			for (int j = 0; j < fmax; j++) {
				for (int k = 0; k < rmax; k++) {
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println();
			}
			if (i != bmax - 1) System.out.println("####################");
		}
	}

}