import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<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 a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			}
		scan.close();
}
} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			}
		scan.close();
} main {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<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 a[][][] = new int[4][3][10]; a new int[4][3][10] 4 3 10 int i; i for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		} {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		} int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan int f=scan.nextInt(); f scan.nextInt() scan.nextInt scan int r=scan.nextInt(); r scan.nextInt() scan.nextInt scan int v=scan.nextInt(); v scan.nextInt() scan.nextInt scan a[b-1][f-1][r-1] +=v a[b-1][f-1][r-1] a[b-1][f-1] a[b-1] a b-1 b 1 f-1 f 1 r-1 r 1 v for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			} int b=0; int b=0; b 0 b<4 b 4 b++ b++ b {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			} {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			} for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			} int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			} {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			} for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				} int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
					System.out.print(" "+ a[b][f][r]);
				} {
					System.out.print(" "+ a[b][f][r]);
				} System.out.print(" "+ a[b][f][r]) System.out.print System.out System System.out " "+ a[b][f][r] " " a[b][f][r] a[b][f] a[b] a b f r System.out.println() System.out.println System.out System System.out if(b<3)
				System.out.println("####################"); b<3 b 3 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 a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<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 a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<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 a[][][] = new int[4][3][10];
		int i;
		for(i=0;i<n;i++) {
			int b=scan.nextInt();
			int f=scan.nextInt();
			int r=scan.nextInt();
			int v=scan.nextInt();
			a[b-1][f-1][r-1] +=v;
		}
		for(int b=0;b<4;b++) {
			for(int f=0;f<3;f++) {
				for(int r=0;r<10;r++) {
					System.out.print(" "+ a[b][f][r]);
				}
				System.out.println();
			}
			if(b<3)
				System.out.println("####################");
			}
		scan.close();
}
}
