import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	}
} import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	} main {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][] A = new int[3][10]; A new int[3][10] 3 10 int[][] B = new int[3][10]; B new int[3][10] 3 10 int[][] C = new int[3][10]; C new int[3][10] 3 10 int[][] D = new int[3][10]; D new int[3][10] 3 10 for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		} {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt() - 1; b sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int c = sc.nextInt() - 1; c sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;} a==1 a 1 {A[b][c] += d;} A[b][c] += d A[b][c] A[b] A b c d if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;} a==2 a 2 {B[b][c] += d;} B[b][c] += d B[b][c] B[b] B b c d if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;} a==3 a 3 {C[b][c] += d;} C[b][c] += d C[b][c] C[b] C b c d if (a==4) {D[b][c] += d;} a==4 a 4 {D[b][c] += d;} D[b][c] += d D[b][c] D[b] D b c d for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		} {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		} for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+A[i][j]);
			} {
				System.out.print(" "+A[i][j]);
			} System.out.print(" "+A[i][j]) System.out.print System.out System System.out " "+A[i][j] " " A[i][j] A[i] A i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		} {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		} for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+B[i][j]);
			} {
				System.out.print(" "+B[i][j]);
			} System.out.print(" "+B[i][j]) System.out.print System.out System System.out " "+B[i][j] " " B[i][j] B[i] B i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		} {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		} for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+C[i][j]);
			} {
				System.out.print(" "+C[i][j]);
			} System.out.print(" "+C[i][j]) System.out.print System.out System System.out " "+C[i][j] " " C[i][j] C[i] C i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		} {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		} for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+D[i][j]);
			} {
				System.out.print(" "+D[i][j]);
			} System.out.print(" "+D[i][j]) System.out.print System.out System System.out " "+D[i][j] " " D[i][j] D[i] D i j System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	}
} Main
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[][] A = new int[3][10];
		int[][] B = new int[3][10];
		int[][] C = new int[3][10];
		int[][] D = new int[3][10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt() - 1;
			int c = sc.nextInt() - 1;
			int d = sc.nextInt();
			if (a==1) {A[b][c] += d;}
			else if (a==2) {B[b][c] += d;}
			else if (a==3) {C[b][c] += d;}
			else if (a==4) {D[b][c] += d;}
		}
		
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+A[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+B[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+C[i][j]);
			}
			System.out.println();
		}
		System.out.println("####################");
		for (int i=0; i<3; i++) {
			for (int j=0; j<10; j++) {
				System.out.print(" "+D[i][j]);
			}
			System.out.println();
		}
	}
}
