import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	}

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

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	}

} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	} main {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					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 []c = new int[340]; c new int[340] 340 for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			} int a = 1 ; int a = 1 ; a 1 a <= n a n ++a ++a a {
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			} {
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} b==1 b 1 {
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				} c[10*f+(r-1)]=c[10*f+(r-1)]+v c[10*f+(r-1)] c 10*f+(r-1) 10*f 10 f (r-1) r 1 c[10*f+(r-1)]+v c[10*f+(r-1)] c 10*f+(r-1) 10*f 10 f (r-1) r 1 v if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} b==2 b 2 {
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 v if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} b==3 b 3 {
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 v if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} b==4 b 4 {
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				} c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 c[100*(b-1)+10*f+(r-1)]+v c[100*(b-1)+10*f+(r-1)] c 100*(b-1)+10*f+(r-1) 100*(b-1)+10*f+(r-1) 100*(b-1) 100 (b-1) b 1 10*f 10 f (r-1) r 1 v for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					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 d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			} {
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			} for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				} int d = 1 ; int d = 1 ; d 1 d <= 3 d 3 ++d ++d d {
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				} {
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				} for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					} int e = 0 ; int e = 0 ; e 0 e <= 9 e 9 ++e ++e e {
						System.out.print(" "+c[100*a+10*d+e]);
					} {
						System.out.print(" "+c[100*a+10*d+e]);
					} System.out.print(" "+c[100*a+10*d+e]) System.out.print System.out System System.out " "+c[100*a+10*d+e] " " c[100*a+10*d+e] c 100*a+10*d+e 100*a+10*d+e 100*a 100 a 10*d 10 d e 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.println System.out System System.out "####################" String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	}

} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	}

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

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int []c = new int[340];		
			
			for(int a = 1 ; a <= n ; ++a){
				int b = sc.nextInt();
				int f = sc.nextInt();
				int r = sc.nextInt();
				int v = sc.nextInt();
				
				if (b==1){
					c[10*f+(r-1)]=c[10*f+(r-1)]+v;
				}else if (b==2){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==3){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}else if (b==4){
					c[100*(b-1)+10*f+(r-1)]=c[100*(b-1)+10*f+(r-1)]+v;
				}
				
			}
			for(int a = 0 ; a <= 3 ; ++a){
				for(int d = 1 ; d <= 3 ; ++d){
					for(int e = 0 ; e <= 9 ; ++e){
						System.out.print(" "+c[100*a+10*d+e]);
					}
					System.out.println();
				}
				if(a!=3){
					System.out.println("####################");
				}
			}
	}

}