import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	} main {
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	} int[][][] array = new int [4][3][10]; array new int [4][3][10] 4 3 10 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		} int i = 0; int i = 0; i 0 i<num i num i++ i++ i {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		} {
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		} int building = sc.nextInt(); building sc.nextInt() sc.nextInt sc int floor = sc.nextInt(); floor sc.nextInt() sc.nextInt sc int room_num = sc.nextInt(); room_num sc.nextInt() sc.nextInt sc int change = sc.nextInt(); change sc.nextInt() sc.nextInt sc array[building-1][floor-1][room_num-1] += change array[building-1][floor-1][room_num-1] array[building-1][floor-1] array[building-1] array building-1 building 1 floor-1 floor 1 room_num-1 room_num 1 change for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		} int j = 0; int j = 0; j 0 j<4 j 4 j++ j++ j {
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		} {
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		} for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			} int k = 0; int k = 0; k 0 k<3 k 3 k++ k++ k {
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			} {
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			} for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				} int l = 0; int l = 0; l 0 l<10 l 10 l++ l++ l {
					System.out.print(" "+array[j][k][l]);
				} {
					System.out.print(" "+array[j][k][l]);
				} System.out.print(" "+array[j][k][l]) System.out.print System.out System System.out " "+array[j][k][l] " " array[j][k][l] array[j][k] array[j] array j k l System.out.println() System.out.println System.out System System.out if(j!=3){
				System.out.println("####################");
			} j!=3 j 3 {
				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){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		int[][][] array = new int [4][3][10];
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();

		for(int i = 0; i<num; i++){
			int building = sc.nextInt();
			int floor = sc.nextInt();
			int room_num = sc.nextInt();
			int change = sc.nextInt();
			array[building-1][floor-1][room_num-1] += change;
		}

		for(int j = 0; j<4; j++){
			for(int k = 0; k<3; k++){
				for(int l = 0; l<10; l++){
					System.out.print(" "+array[j][k][l]);
				}
				System.out.println();
			}
			if(j!=3){
				System.out.println("####################");
			}
		}
	}
}
