import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				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 x[] = new int[120]; x new int[120] 120 for(int i=0; i<120; i++){
			x[i]=0;
		} int i=0; int i=0; i 0 i<120 i 120 i++ i++ i {
			x[i]=0;
		} {
			x[i]=0;
		} x[i]=0 x[i] x i 0 for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		} 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 v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		} {
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-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 int num=(b-1)*30+(f-1)*10+r; num (b-1)*30+(f-1)*10+r (b-1)*30+(f-1)*10+r (b-1)*30 (b-1) b 1 30 (f-1)*10 (f-1) f 1 10 r x[num-1]=x[num-1] + v x[num-1] x num-1 num 1 x[num-1] + v x[num-1] x num-1 num 1 v for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		} int i=1; int i=1; i 1 i<121 i 121 i++ i++ i {
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		} {
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		} System.out.print(" " + x[i-1]) System.out.print System.out System System.out " " + x[i-1] " " x[i-1] x i-1 i 1 if(i%10==0){
				System.out.println();
			} i%10==0 i%10 i 10 0 {
				System.out.println();
			} System.out.println() System.out.println System.out System System.out if(i%30==0 && i!=120){
				System.out.println("####################");
			} i%30==0 && i!=120 i%30==0 i%30 i 30 0 i!=120 i 120 {
				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) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x[] = new int[120];
		for(int i=0; i<120; i++){
			x[i]=0;
		}
		for(int i=0; i<n; i++){
			int b = sc.nextInt();  //?£?
			int f = sc.nextInt();  //???
			int r = sc.nextInt();  //??????
			int v = sc.nextInt();  //?????°
			int num=(b-1)*30+(f-1)*10+r;
			x[num-1]=x[num-1] + v;
		}
		for(int i=1; i<121; i++){
			System.out.print(" " + x[i-1]);
			if(i%10==0){
				System.out.println();
			}
			if(i%30==0 && i!=120){
				System.out.println("####################");
			}
		}
	}
}