import java.text.*;
import java.math.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	}
} import java.text.*; text.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int kazu = scan.nextInt(); kazu scan.nextInt() scan.nextInt scan int num[][][] = new int[4][3][10]; num new int[4][3][10] 4 3 10 int b b f f r r v; v for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		} int i = 0; int i = 0; i 0 i < kazu i kazu i++ i++ i {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		} {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		} b = scan.nextInt() - 1 b scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 f = scan.nextInt() - 1 f scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 r = scan.nextInt() - 1 r scan.nextInt() - 1 scan.nextInt() scan.nextInt scan 1 v = scan.nextInt() v scan.nextInt() scan.nextInt scan num[b][f][r] += v num[b][f][r] num[b][f] num[b] num b f r v for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		} int i0 = 0; int i0 = 0; i0 0 i0 < 4 i0 4 i0++ i0++ i0 {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		} {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		} for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			} int i1 = 0; int i1 = 0; i1 0 i1 < 3 i1 3 i1++ i1++ i1 {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			} {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			} for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				} int i2 = 0; int i2 = 0; i2 0 i2 < 10 i2 10 i2++ i2++ i2 {
					System.out.print(" " + num[i0][i1][i2]);
				} {
					System.out.print(" " + num[i0][i1][i2]);
				} System.out.print(" " + num[i0][i1][i2]) System.out.print System.out System System.out " " + num[i0][i1][i2] " " num[i0][i1][i2] num[i0][i1] num[i0] num i0 i1 i2 System.out.println() System.out.println System.out System System.out if(i0 < 3) System.out.println("####################"); i0 < 3 i0 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	}
} Main
import java.text.*;
import java.math.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int kazu = scan.nextInt();
		int num[][][] = new int[4][3][10];
		int b,f,r,v;
		
		for(int i = 0; i < kazu; i++) {
			b = scan.nextInt() - 1;
			f = scan.nextInt() - 1;
			r = scan.nextInt() - 1;
			v = scan.nextInt();
			num[b][f][r] += v;
		}
		for(int i0 = 0; i0 < 4; i0++ ) {
			for(int i1 = 0; i1 < 3; i1++) {
				for(int i2 = 0; i2 < 10; i2++) {
					System.out.print(" " + num[i0][i1][i2]);
				}
				System.out.println();
			}
			if(i0 < 3) System.out.println("####################");
		}
	}
}