import java.util.Scanner;
public class Main{

	static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	}
}
 import java.util.Scanner; Scanner java.util public class Main{

	static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	}
} Main static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	} Print {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	} for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[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(" "+x[i][j]);
			}
			System.out.println("");
		} {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		} for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+x[i][j]);
			} {
				System.out.print(" "+x[i][j]);
			} System.out.print(" "+x[i][j]) System.out.print System.out System System.out " "+x[i][j] " " x[i][j] x[i] x i j System.out.println("") System.out.println System.out System System.out "" int[][] x x public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1[][] = new int[3][10]; a1 new int[3][10] 3 10 int a2[][] = new int[3][10]; a2 new int[3][10] 3 10 int a3[][] = new int[3][10]; a3 new int[3][10] 3 10 int a4[][] = new int[3][10]; a4 new int[3][10] 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		} {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		} 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 count = sc.nextInt(); count sc.nextInt() sc.nextInt sc if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E"); b==1 b 1 a1[f-1][r-1]+=count a1[f-1][r-1] a1[f-1] a1 f-1 f 1 r-1 r 1 count if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E"); b==2 b 2 a2[f-1][r-1]+=count a2[f-1][r-1] a2[f-1] a2 f-1 f 1 r-1 r 1 count if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E"); b==3 b 3 a3[f-1][r-1]+=count a3[f-1][r-1] a3[f-1] a3 f-1 f 1 r-1 r 1 count if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E"); b==4 b 4 a4[f-1][r-1]+=count a4[f-1][r-1] a4[f-1] a4 f-1 f 1 r-1 r 1 count System.out.println("E") System.out.println System.out System System.out "E" Print(a1) Print a1 System.out.println("####################") System.out.println System.out System System.out "####################" Print(a2) Print a2 System.out.println("####################") System.out.println System.out System System.out "####################" Print(a3) Print a3 System.out.println("####################") System.out.println System.out System System.out "####################" Print(a4) Print a4 sc.close() sc.close sc String[] args args public class Main{

	static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	}
} public class Main{

	static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	}
} Main
import java.util.Scanner;
public class Main{

	static void Print(int[][] x) {
		for(int i=0;i<3;i++) {
			for(int j=0;j<10;j++) {
				System.out.print(" "+x[i][j]);
			}
			System.out.println("");
		}
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a1[][] = new int[3][10];
		int a2[][] = new int[3][10];
		int a3[][] = new int[3][10];
		int a4[][] = new int[3][10];
		int n = sc.nextInt();

		for(int i=0;i<n;i++) {
			int b = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			int count = sc.nextInt();

			if(b==1)a1[f-1][r-1]+=count;
			else if(b==2)a2[f-1][r-1]+=count;
			else if(b==3)a3[f-1][r-1]+=count;
			else if(b==4)a4[f-1][r-1]+=count;
			else System.out.println("E");
		}

		Print(a1);
		System.out.println("####################");
		Print(a2);
		System.out.println("####################");
		Print(a3);
		System.out.println("####################");
		Print(a4);

		sc.close();
	}
}

