import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} import java.util.*; util.* java public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} Main private static final Scanner scan = new Scanner(System.in); scan new Scanner(System.in) public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	} main {
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	} int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		} {
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += 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 house[b - 1][f - 1][r - 1] += v house[b - 1][f - 1][r - 1] house[b - 1][f - 1] house[b - 1] house b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		} {
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		} for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			} {
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			} for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				} {
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				} if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					} k != 9 k 9 {
						System.out.printf(" %d", house[i][j][k]);
					} System.out.printf(" %d", house[i][j][k]) System.out.printf System.out System System.out " %d" house[i][j][k] house[i][j] house[i] house i j k {
						System.out.printf(" %d\n", house[i][j][k]);
					} System.out.printf(" %d\n", house[i][j][k]) System.out.printf System.out System System.out " %d\n" house[i][j][k] house[i][j] house[i] house i j k if(i != 3){
				System.out.println("####################");
			} i != 3 i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int[][][] house = new int[4][3][10];
		int n = scan.nextInt();

		for(int i = 0; i < n; i++){
			int b = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int v = scan.nextInt();
			house[b - 1][f - 1][r - 1] += v;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					if(k != 9){
						System.out.printf(" %d", house[i][j][k]);
					} else{
						System.out.printf(" %d\n", house[i][j][k]);
					}
				}
			}
			if(i != 3){
				System.out.println("####################");
			}
		}
	}
}