import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	} main {
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][] a; a a = new int[13][11] a new int[13][11] 13 11 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int i; i for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		} i = 1; i = 1 i 1 i <= n i n ++i ++i i {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		} {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		} int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v a[(b - 1) * 3 + f][r] a[(b - 1) * 3 + f] a (b - 1) * 3 + f (b - 1) * 3 (b - 1) b 1 3 f r a[(b - 1) * 3 + f][r] + v a[(b - 1) * 3 + f][r] a[(b - 1) * 3 + f] a (b - 1) * 3 + f (b - 1) * 3 (b - 1) b 1 3 f r v int q; q for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		} i = 1; i = 1 i 1 i <= 12 i 12 ++i ++i i {
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		} {
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		} for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				} q = 1; q = 1 q 1 q <= 10 q 10 ++q ++q q {
				System.out.print(" "+a[i][q]);
				} {
				System.out.print(" "+a[i][q]);
				} System.out.print(" "+a[i][q]) System.out.print System.out System System.out " "+a[i][q] " " a[i][q] a[i] a i q if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			} i % 3 == 0 i % 3 i 3 0 {
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			} if(i == 12)
					break; i == 12 i 12 break; System.out.println() System.out.println System.out System System.out for(int v = 1;v <= 20; ++v)
				System.out.print("#"); int v = 1; int v = 1; v 1 v <= 20 v 20 ++v ++v v System.out.print("#"); System.out.print("#") System.out.print System.out System System.out "#" if(i == 12)
				break; i == 12 i 12 break; System.out.println() System.out.println System.out System System.out 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[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[][] a;
		a = new int[13][11];
		int n = scan.nextInt();
		int i;
		for(i = 1; i <= n; ++i){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			a[(b - 1) * 3 + f][r] = a[(b - 1) * 3 + f][r] + v;
		}
		int q;
		for(i = 1; i <= 12; ++i){
			for(q = 1; q <= 10; ++q){
				System.out.print(" "+a[i][q]);
				}
			if(i % 3 == 0){
				if(i == 12)
					break;
				System.out.println();
				for(int v = 1;v <= 20; ++v)
				System.out.print("#");
			}
			if(i == 12)
				break;
			System.out.println();
		}
		System.out.println();
	}
}