import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	} main {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				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 b b f f r r v; v int[][][] num = new int[4][3][10]; num new int[4][3][10] 4 3 10 for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		} int a=0; int a=0; a 0 a<4 a 4 a++ a++ a {
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		} {
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		} for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			} int c=0; int c=0; c 0 c<3 c 3 c++ c++ c {
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			} {
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			} for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				} int d=0; int d=0; d 0 d<10 d 10 d++ d++ d {
					num[a][c][d] = 0;
				} {
					num[a][c][d] = 0;
				} num[a][c][d] = 0 num[a][c][d] num[a][c] num[a] num a c d 0 for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		} int a=0; int a=0; a 0 a<n a n a++ a++ a {
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		} {
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		} b=sc.nextInt() b sc.nextInt() sc.nextInt sc f=sc.nextInt() f sc.nextInt() sc.nextInt sc r=sc.nextInt() r sc.nextInt() sc.nextInt sc v=sc.nextInt() v sc.nextInt() sc.nextInt sc num[b-1][f-1][r-1] += v num[b-1][f-1][r-1] num[b-1][f-1] num[b-1] num b-1 b 1 f-1 f 1 r-1 r 1 v for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		} int a=0; int a=0; a 0 a<4 a 4 a++ a++ a {
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		} {
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		} for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			} int c=0; int c=0; c 0 c<3 c 3 c++ c++ c {
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			} {
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			} for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				} int d=0; int d=0; d 0 d<10 d 10 d++ d++ d {
					System.out.print(" "+num[a][c][d]);
				} {
					System.out.print(" "+num[a][c][d]);
				} System.out.print(" "+num[a][c][d]) System.out.print System.out System System.out " "+num[a][c][d] " " num[a][c][d] num[a][c] num[a] num a c d 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) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int b,f,r,v;
		int[][][] num = new int[4][3][10];
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					num[a][c][d] = 0;
				}
			}
		}
		for (int a=0;a<n;a++){
			b=sc.nextInt();f=sc.nextInt();
			r=sc.nextInt();v=sc.nextInt();
			num[b-1][f-1][r-1] += v;
		}
		for (int a=0;a<4;a++){
			for (int c=0;c<3;c++){
				for (int d=0;d<10;d++){
					System.out.print(" "+num[a][c][d]);
				}
				System.out.println();
			}
			if (a<3){
				System.out.println("####################");
			}
		}
	}
}