import java.util.Scanner;
class Main {
	int[][][] t = new int [5][5][11];
	int n = 0, b = 0, f = 0, r = 0, v = 0, i = 0, k = 0;
	public void of() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		}
		
		for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args) {
		new Main().of();
	}
} import java.util.Scanner; Scanner java.util class Main {
	int[][][] t = new int [5][5][11];
	int n = 0, b = 0, f = 0, r = 0, v = 0, i = 0, k = 0;
	public void of() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		}
		
		for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args) {
		new Main().of();
	}
} Main int[][][] t = new int [5][5][11]; t new int [5][5][11] 5 5 11 int n = 0 n 0 b = 0 b 0 f = 0 f 0 r = 0 r 0 v = 0 v 0 i = 0 i 0 k = 0; k 0 public void of() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		}
		
		for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		}
	} of {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		}
		
		for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 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 = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		} 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 switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			} b case 1: 1 case 1: t[1][f][r] += v t[1][f][r] t[1][f] t[1] t 1 f r v break; case 2: 2 case 2: t[2][f][r] += v t[2][f][r] t[2][f] t[2] t 2 f r v break; case 3: 3 case 3: t[3][f][r] += v t[3][f][r] t[3][f] t[3] t 3 f r v break; case 4: 4 case 4: t[4][f][r] += v t[4][f][r] t[4][f] t[4] t 4 f r v break; default: default: break; for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		} n = 1; n = 1 n 1 n <= 4 n 4 n++ n++ n {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		} {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		} for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			} i = 1; i = 1 i 1 i < 4 i 4 i++ i++ i {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			} {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			} for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				} k = 1; k = 1 k 1 k < 11 k 11 k++ k++ k {
							System.out.printf(" %d",t[n][i][k]);
				} {
							System.out.printf(" %d",t[n][i][k]);
				} System.out.printf(" %d",t[n][i][k]) System.out.printf System.out System System.out " %d" t[n][i][k] t[n][i] t[n] t n i k System.out.println() System.out.println System.out System System.out if(n < 4) {
				System.out.println("####################");
			} n < 4 n 4 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" public static void main(String[] args) {
		new Main().of();
	} main {
		new Main().of();
	} new Main().of() new Main().of new Main() String[] args args
import java.util.Scanner;
class Main {
	int[][][] t = new int [5][5][11];
	int n = 0, b = 0, f = 0, r = 0, v = 0, i = 0, k = 0;
	public void of() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(i = 1; i <= n; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			switch(b) {
				case 1:
					t[1][f][r] += v;
					break;
				case 2:
					t[2][f][r] += v;
					break;
				case 3:
					t[3][f][r] += v;
					break;
				case 4:
					t[4][f][r] += v;
					break;
				default:
					break;
			}
		}
		
		for(n = 1; n <= 4; n++) {
			for(i = 1; i < 4; i++) {
				for(k = 1; k < 11; k++) {
							System.out.printf(" %d",t[n][i][k]);
				}
				System.out.println();
			}
			if(n < 4) {
				System.out.println("####################");
			}
		}
	}
	public static void main(String[] args) {
		new Main().of();
	}
}