import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					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 i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int i i j j k; k int floor1[][]; floor1 int floor2[][]; floor2 int floor3[][]; floor3 int floor4[][]; floor4 floor1 = new int[3][10] floor1 new int[3][10] 3 10 floor2 = new int[3][10] floor2 new int[3][10] 3 10 floor3 = new int[3][10] floor3 new int[3][10] 3 10 floor4 = new int[3][10] floor4 new int[3][10] 3 10 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int v; v int w; w for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		} k = 1; k = 1 k 1 k <= n k n k++ k++ k {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		} {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[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 v = scan.nextInt() v scan.nextInt() scan.nextInt scan w = v w v if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
} b == 1 && v <= 9 b == 1 b 1 v <= 9 v 9 {
	floor1[f-1][r-1] += v;
} floor1[f-1][r-1] += v floor1[f-1][r-1] floor1[f-1] floor1 f-1 f 1 r-1 r 1 v if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
} b == 2 &&  v <= 9 b == 2 b 2 v <= 9 v 9 {
	floor2[f-1][r-1] += v;
} floor2[f-1][r-1] += v floor2[f-1][r-1] floor2[f-1] floor2 f-1 f 1 r-1 r 1 v if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
} b == 3 &&  v <= 9 b == 3 b 3 v <= 9 v 9 {
	floor3[f-1][r-1] += v;
} floor3[f-1][r-1] += v floor3[f-1][r-1] floor3[f-1] floor3 f-1 f 1 r-1 r 1 v if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
} b == 4 &&  v <= 9 b == 4 b 4 v <= 9 v 9 {
	floor4[f-1][r-1] += v;
} floor4[f-1][r-1] += v floor4[f-1][r-1] floor4[f-1] floor4 f-1 f 1 r-1 r 1 v for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} i = 0; i = 0 i 0 i < 10 i 10 i++ i++ i {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} System.out.print(" "+floor1[j][i]) System.out.print System.out System System.out " "+floor1[j][i] " " floor1[j][i] floor1[j] floor1 j i if(i >= 9){
					System.out.println();
				} i >= 9 i 9 {
					System.out.println();
				} System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} i = 0; i = 0 i 0 i < 10 i 10 i++ i++ i {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} System.out.print(" "+floor2[j][i]) System.out.print System.out System System.out " "+floor2[j][i] " " floor2[j][i] floor2[j] floor2 j i if(i >= 9){
					System.out.println();
				} i >= 9 i 9 {
					System.out.println();
				} System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} i = 0; i = 0 i 0 i < 10 i 10 i++ i++ i {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} System.out.print(" "+floor3[j][i]) System.out.print System.out System System.out " "+floor3[j][i] " " floor3[j][i] floor3[j] floor3 j i if(i >= 9){
					System.out.println();
				} i >= 9 i 9 {
					System.out.println();
				} System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		} for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} i = 0; i = 0 i 0 i < 10 i 10 i++ i++ i {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			} System.out.print(" "+floor4[j][i]) System.out.print System.out System System.out " "+floor4[j][i] " " floor4[j][i] floor4[j] floor4 j i if(i >= 9){
					System.out.println();
				} i >= 9 i 9 {
					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) {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int i, j, k;
		int floor1[][];
		int floor2[][];
		int floor3[][];
		int floor4[][];
		floor1 = new int[3][10];
		floor2 = new int[3][10];
		floor3 = new int[3][10];
		floor4 = new int[3][10];
		
		int n = scan.nextInt();
		int v;
		int w;
		
	
	
		for (k = 1; k <= n; k++) {
			
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			v = scan.nextInt();
			w = v;
		
if(b == 1 && v <= 9){
	floor1[f-1][r-1] += v;
}else if(b == 2 &&  v <= 9){
	floor2[f-1][r-1] += v;
}else if(b == 3 &&  v <= 9){
	floor3[f-1][r-1] += v;
}else if(b == 4 &&  v <= 9){
	floor4[f-1][r-1] += v;
}


		}
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				
				System.out.print(" "+floor1[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor2[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor3[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
		System.out.println("####################");
		for (j = 0; j < 3; j++) {
			for (i = 0; i < 10; i++) {
				System.out.print(" "+floor4[j][i]);
				if(i >= 9){
					System.out.println();
				}
				
			}
		}
	}

}