import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	} main {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	} int N_FLOOR = 10; N_FLOOR 10 int N_H = 3; N_H 3 int N_TO = 4; N_TO 4 int table[][][] = new int[N_TO][N_H][N_FLOOR]; table new int[N_TO][N_H][N_FLOOR] N_TO N_H N_FLOOR int n n b b f f r r v; v Scanner in = new Scanner(System.in); in new Scanner(System.in) n = in.nextInt() n in.nextInt() in.nextInt in for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

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

			table[b][f][r] += v;
		} {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		} b = in.nextInt() - 1 b in.nextInt() - 1 in.nextInt() in.nextInt in 1 f = in.nextInt() - 1 f in.nextInt() - 1 in.nextInt() in.nextInt in 1 r = in.nextInt() - 1 r in.nextInt() - 1 in.nextInt() in.nextInt in 1 v = in.nextInt() v in.nextInt() in.nextInt in table[b][f][r] += v table[b][f][r] table[b][f] table[b] table b f r v for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		} int i=0; int i=0; i 0 i < N_TO i N_TO i++ i++ i {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		} {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		} for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			} int j=0; int j=0; j 0 j<N_H j N_H j++ j++ j {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			} {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			} for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				} int k=0; int k=0; k 0 k<N_FLOOR k N_FLOOR k++ k++ k {
					System.out.print(" "+table[i][j][k]);
				} {
					System.out.print(" "+table[i][j][k]);
				} System.out.print(" "+table[i][j][k]) System.out.print System.out System System.out " "+table[i][j][k] " " table[i][j][k] table[i][j] table[i] table i j k System.out.println("") System.out.println System.out System System.out "" if(i != N_TO-1) {
				System.out.println("####################");
			} i != N_TO-1 i N_TO-1 N_TO 1 {
				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) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int N_FLOOR = 10;
		int N_H = 3;
		int N_TO = 4;
		int table[][][] = new int[N_TO][N_H][N_FLOOR];

		int n, b, f, r, v;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		for(int i=0;i<n;i++) {
			b = in.nextInt() - 1;
			f = in.nextInt() - 1;
			r = in.nextInt() - 1;
			v = in.nextInt();

			table[b][f][r] += v;
		}
		for(int i=0; i < N_TO;i++) {
			for(int j=0;j<N_H;j++) {
				for(int k=0;k<N_FLOOR;k++) {
					System.out.print(" "+table[i][j][k]);
				}
				System.out.println("");
			}
			if(i != N_TO-1) {
				System.out.println("####################");
			}
		}
	}
}