import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	} main {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn int y[][][] = new int[5][4][11]; y new int[5][4][11] 5 4 11 for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		} int i=0; int i=0; i 0 i < x i x i++ i++ i {
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		} {
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		} int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn int f = stdIn.nextInt(); f stdIn.nextInt() stdIn.nextInt stdIn int r = stdIn.nextInt(); r stdIn.nextInt() stdIn.nextInt stdIn int v = stdIn.nextInt(); v stdIn.nextInt() stdIn.nextInt stdIn y[b][f][r]+= v y[b][f][r] y[b][f] y[b] y b f r v stdIn.close() stdIn.close stdIn for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		} int a=1; int a=1; a 1 a <= 4 a 4 a++ a++ a {
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		} {
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		} for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			} int c=1; int c=1; c 1 c <= 3 c 3 c++ c++ c {
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			} {
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			} for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				} int d=1; int d=1; d 1 d <= 10 d 10 d++ d++ d {
						System.out.printf(" %d",y[a][c][d]);
				} {
						System.out.printf(" %d",y[a][c][d]);
				} System.out.printf(" %d",y[a][c][d]) System.out.printf System.out System System.out " %d" y[a][c][d] y[a][c] y[a] y a c d System.out.println() System.out.println System.out System System.out if(a != 4){
				System.out.println("####################");
			} a != 4 a 4 {
				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 stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int x = stdIn.nextInt();
		int y[][][] = new int[5][4][11];
		for(int i=0; i < x; i++){
			int b = stdIn.nextInt();
			int f = stdIn.nextInt();
			int r = stdIn.nextInt();
			int v = stdIn.nextInt();

		    y[b][f][r]+= v;
		}
		stdIn.close();
		for(int a=1; a <= 4; a++){
			for(int c=1; c <= 3; c++){
				for(int d=1; d <= 10; d++){
						System.out.printf(" %d",y[a][c][d]);
				}
				System.out.println();
			}
			if(a != 4){
				System.out.println("####################");
			}
		}
	}
}

