import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	}
} Main public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	} main {

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	} Scanner sc = new Scanner (System.in); sc new Scanner (System.in) int n= sc.nextInt(); n sc.nextInt() sc.nextInt sc int bfr[][][]= new int[4][3][10]; bfr new int[4][3][10] 4 3 10 int b b f f r; r int v=0; v 0 for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		} {
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		} b= sc.nextInt() b sc.nextInt() sc.nextInt sc f=sc.nextInt() f sc.nextInt() sc.nextInt sc r=sc.nextInt() r sc.nextInt() sc.nextInt sc v=sc.nextInt() v sc.nextInt() sc.nextInt sc bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v bfr[b-1][f-1][r-1] bfr[b-1][f-1] bfr[b-1] bfr b-1 b 1 f-1 f 1 r-1 r 1 bfr[b-1][f-1][r-1] + v bfr[b-1][f-1][r-1] bfr[b-1][f-1] bfr[b-1] bfr b-1 b 1 f-1 f 1 r-1 r 1 v for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		} int a=0; int a=0; a 0 a<=3 a 3 ++a ++a a {
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		} {
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		} for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			} int aa =0; int aa =0; aa 0 aa<=2 aa 2 ++aa ++aa aa {
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			} {
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			} for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				} int aaa = 0; int aaa = 0; aaa 0 aaa<=9 aaa 9 ++aaa ++aaa aaa {
					System.out.print(" "+bfr[a][aa][aaa]);
				} {
					System.out.print(" "+bfr[a][aa][aaa]);
				} System.out.print(" "+bfr[a][aa][aaa]) System.out.print System.out System System.out " "+bfr[a][aa][aaa] " " bfr[a][aa][aaa] bfr[a][aa] bfr[a] bfr a aa aaa System.out.println() System.out.println System.out System System.out if (a!=3)System.out.println("####################"); a!=3 a 3 System.out.println("####################") System.out.println System.out System System.out "####################" String args[] args public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	}
} public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner (System.in);
		int n= sc.nextInt();
		int bfr[][][]= new int[4][3][10];
		int b,f,r;
		int v=0;

		for(int i=0;i<n;++i){
			b= sc.nextInt();
			f=sc.nextInt();
			r=sc.nextInt();
			v=sc.nextInt();
			bfr[b-1][f-1][r-1]= bfr[b-1][f-1][r-1] + v;
		}
		for (int a=0;a<=3;++a){
			for (int aa =0;aa<=2;++aa){
				for (int aaa = 0; aaa<=9;++aaa){
					System.out.print(" "+bfr[a][aa][aaa]);
				}
				System.out.println();
			}
			if (a!=3)System.out.println("####################");
		}

	}
}
