import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException{

		final int floor_num = 3;
		final int room_num = 10;
		int[][] building_1 = new int[floor_num][room_num];
		int[][] building_2 = new int[floor_num][room_num];
		int[][] building_3 = new int[floor_num][room_num];
		int[][] building_4 = new int[floor_num][room_num];

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int input_num = Integer.parseInt(br.readLine());

		for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		}

		output(building_1, floor_num, room_num);
		separate();
		output(building_2, floor_num, room_num);
		separate();
		output(building_3, floor_num, room_num);
		separate();
		output(building_4, floor_num, room_num);

	}

	public static void output(int[][] building, int floor_num, int room_num){

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		}

	}

	public static void separate(){

		for(int i = 0; i < 20; i++){
			System.out.print("#");
		}

		System.out.print("\n");

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main{

	public static void main(String[] args) throws IOException{

		final int floor_num = 3;
		final int room_num = 10;
		int[][] building_1 = new int[floor_num][room_num];
		int[][] building_2 = new int[floor_num][room_num];
		int[][] building_3 = new int[floor_num][room_num];
		int[][] building_4 = new int[floor_num][room_num];

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int input_num = Integer.parseInt(br.readLine());

		for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		}

		output(building_1, floor_num, room_num);
		separate();
		output(building_2, floor_num, room_num);
		separate();
		output(building_3, floor_num, room_num);
		separate();
		output(building_4, floor_num, room_num);

	}

	public static void output(int[][] building, int floor_num, int room_num){

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		}

	}

	public static void separate(){

		for(int i = 0; i < 20; i++){
			System.out.print("#");
		}

		System.out.print("\n");

	}
} Main public static void main(String[] args) throws IOException{

		final int floor_num = 3;
		final int room_num = 10;
		int[][] building_1 = new int[floor_num][room_num];
		int[][] building_2 = new int[floor_num][room_num];
		int[][] building_3 = new int[floor_num][room_num];
		int[][] building_4 = new int[floor_num][room_num];

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int input_num = Integer.parseInt(br.readLine());

		for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		}

		output(building_1, floor_num, room_num);
		separate();
		output(building_2, floor_num, room_num);
		separate();
		output(building_3, floor_num, room_num);
		separate();
		output(building_4, floor_num, room_num);

	} main {

		final int floor_num = 3;
		final int room_num = 10;
		int[][] building_1 = new int[floor_num][room_num];
		int[][] building_2 = new int[floor_num][room_num];
		int[][] building_3 = new int[floor_num][room_num];
		int[][] building_4 = new int[floor_num][room_num];

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int input_num = Integer.parseInt(br.readLine());

		for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		}

		output(building_1, floor_num, room_num);
		separate();
		output(building_2, floor_num, room_num);
		separate();
		output(building_3, floor_num, room_num);
		separate();
		output(building_4, floor_num, room_num);

	} final int floor_num = 3; floor_num 3 final int room_num = 10; room_num 10 int[][] building_1 = new int[floor_num][room_num]; building_1 new int[floor_num][room_num] floor_num room_num int[][] building_2 = new int[floor_num][room_num]; building_2 new int[floor_num][room_num] floor_num room_num int[][] building_3 = new int[floor_num][room_num]; building_3 new int[floor_num][room_num] floor_num room_num int[][] building_4 = new int[floor_num][room_num]; building_4 new int[floor_num][room_num] floor_num room_num for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		} int i = 0; int i = 0; i 0 i < floor_num i floor_num i++ i++ i {
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		} {
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		} for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			} int j = 0; int j = 0; j 0 j < room_num j room_num j++ j++ j {
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			} {
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			} building_1[i][j] = 0 building_1[i][j] building_1[i] building_1 i j 0 building_2[i][j] = 0 building_2[i][j] building_2[i] building_2 i j 0 building_3[i][j] = 0 building_3[i][j] building_3[i] building_3 i j 0 building_4[i][j] = 0 building_4[i][j] building_4[i] building_4 i j 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int input_num = Integer.parseInt(br.readLine()); input_num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		} int i = 0; int i = 0; i 0 i < input_num i input_num i++ i++ i {

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		} {

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		} String[] token = br.readLine().split(" "); token br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int select_building = Integer.parseInt(token[0]); select_building Integer.parseInt(token[0]) Integer.parseInt Integer token[0] token 0 int select_floor = Integer.parseInt(token[1]); select_floor Integer.parseInt(token[1]) Integer.parseInt Integer token[1] token 1 int select_room = Integer.parseInt(token[2]); select_room Integer.parseInt(token[2]) Integer.parseInt Integer token[2] token 2 int resident = Integer.parseInt(token[3]); resident Integer.parseInt(token[3]) Integer.parseInt Integer token[3] token 3 switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			} select_building case 1: 1 case 1: building_1[select_floor - 1][select_room - 1] += resident building_1[select_floor - 1][select_room - 1] building_1[select_floor - 1] building_1 select_floor - 1 select_floor 1 select_room - 1 select_room 1 resident break; case 2: 2 case 2: building_2[select_floor - 1][select_room - 1] += resident building_2[select_floor - 1][select_room - 1] building_2[select_floor - 1] building_2 select_floor - 1 select_floor 1 select_room - 1 select_room 1 resident break; case 3: 3 case 3: building_3[select_floor - 1][select_room - 1] += resident building_3[select_floor - 1][select_room - 1] building_3[select_floor - 1] building_3 select_floor - 1 select_floor 1 select_room - 1 select_room 1 resident break; case 4: 4 case 4: building_4[select_floor - 1][select_room - 1] += resident building_4[select_floor - 1][select_room - 1] building_4[select_floor - 1] building_4 select_floor - 1 select_floor 1 select_room - 1 select_room 1 resident break; output(building_1, floor_num, room_num) output building_1 floor_num room_num separate() separate output(building_2, floor_num, room_num) output building_2 floor_num room_num separate() separate output(building_3, floor_num, room_num) output building_3 floor_num room_num separate() separate output(building_4, floor_num, room_num) output building_4 floor_num room_num String[] args args public static void output(int[][] building, int floor_num, int room_num){

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		}

	} output {

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		}

	} for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		} int i = 0; int i = 0; i 0 i < floor_num i floor_num i++ i++ i {
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		} {
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		} for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			} int j = 0; int j = 0; j 0 j < room_num j room_num j++ j++ j {

				System.out.print(" " + building[i][j]);

			} {

				System.out.print(" " + building[i][j]);

			} System.out.print(" " + building[i][j]) System.out.print System.out System System.out " " + building[i][j] " " building[i][j] building[i] building i j System.out.print("\n") System.out.print System.out System System.out "\n" int[][] building building int floor_num floor_num int room_num room_num public static void separate(){

		for(int i = 0; i < 20; i++){
			System.out.print("#");
		}

		System.out.print("\n");

	} separate {

		for(int i = 0; i < 20; i++){
			System.out.print("#");
		}

		System.out.print("\n");

	} for(int i = 0; i < 20; i++){
			System.out.print("#");
		} int i = 0; int i = 0; i 0 i < 20 i 20 i++ i++ i {
			System.out.print("#");
		} {
			System.out.print("#");
		} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n"
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException{

		final int floor_num = 3;
		final int room_num = 10;
		int[][] building_1 = new int[floor_num][room_num];
		int[][] building_2 = new int[floor_num][room_num];
		int[][] building_3 = new int[floor_num][room_num];
		int[][] building_4 = new int[floor_num][room_num];

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){
				building_1[i][j] = 0;
				building_2[i][j] = 0;
				building_3[i][j] = 0;
				building_4[i][j] = 0;
			}
		}

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int input_num = Integer.parseInt(br.readLine());

		for(int i = 0; i < input_num; i++){

			String[] token = br.readLine().split(" ");
			int select_building = Integer.parseInt(token[0]);
			int select_floor = Integer.parseInt(token[1]);
			int select_room = Integer.parseInt(token[2]);
			int resident = Integer.parseInt(token[3]);

			switch(select_building){
				case 1:
					building_1[select_floor - 1][select_room - 1] += resident;
					break;
				case 2:
					building_2[select_floor - 1][select_room - 1] += resident;
					break;
				case 3:
					building_3[select_floor - 1][select_room - 1] += resident;
					break;
				case 4:
					building_4[select_floor - 1][select_room - 1] += resident;
					break;
			}

		}

		output(building_1, floor_num, room_num);
		separate();
		output(building_2, floor_num, room_num);
		separate();
		output(building_3, floor_num, room_num);
		separate();
		output(building_4, floor_num, room_num);

	}

	public static void output(int[][] building, int floor_num, int room_num){

		for(int i = 0; i < floor_num; i++){
			for(int j = 0; j < room_num; j++){

				System.out.print(" " + building[i][j]);

			}
			System.out.print("\n");
		}

	}

	public static void separate(){

		for(int i = 0; i < 20; i++){
			System.out.print("#");
		}

		System.out.print("\n");

	}
}