import java.util.Scanner;
class Main {
	int n,i,x,y,z,b,f,r,v;
	int[][][] count = new int[5][4][11];
	public void suzuki(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		}
		for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args){
		new Main().suzuki();
	}
} import java.util.Scanner; Scanner java.util class Main {
	int n,i,x,y,z,b,f,r,v;
	int[][][] count = new int[5][4][11];
	public void suzuki(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		}
		for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args){
		new Main().suzuki();
	}
} Main int n n i i x x y y z z b b f f r r v; v int[][][] count = new int[5][4][11]; count new int[5][4][11] 5 4 11 public void suzuki(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		}
		for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		}
	} suzuki {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		}
		for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		} i = 0; i = 0 i 0 i < n i n i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += 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 count[b][f][r] += v count[b][f][r] count[b][f] count[b] count b f r v for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		} x = 1; x = 1 x 1 x <= 4 x 4 x++ x++ x {
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		} {
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		} for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			} y = 1; y = 1 y 1 y < 4 y 4 y++ y++ y {
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			} {
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			} for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				} z = 1; z = 1 z 1 z < 11 z 11 z++ z++ z {
					System.out.print(" " + count[x][y][z]);
				} {
					System.out.print(" " + count[x][y][z]);
				} System.out.print(" " + count[x][y][z]) System.out.print System.out System System.out " " + count[x][y][z] " " count[x][y][z] count[x][y] count[x] count x y z System.out.println() System.out.println System.out System System.out if(x < 4){
				System.out.println("####################");
			} x < 4 x 4 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" public static void main(String[] args){
		new Main().suzuki();
	} main {
		new Main().suzuki();
	} new Main().suzuki() new Main().suzuki new Main() String[] args args
import java.util.Scanner;
class Main {
	int n,i,x,y,z,b,f,r,v;
	int[][][] count = new int[5][4][11];
	public void suzuki(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 0;i < n;i++){
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			count[b][f][r] += v;
		}
		for(x = 1;x <= 4;x++){
			for(y = 1;y < 4;y++){
				for(z = 1;z < 11;z++){
					System.out.print(" " + count[x][y][z]);
				}
				System.out.println();
			}
			if(x < 4){
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args){
		new Main().suzuki();
	}
}