import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;



public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	}

} import java.util.Arrays; Arrays java.util import java.util.InputMismatchException; InputMismatchException java.util import java.util.Scanner; Scanner java.util public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	}

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

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	} main {

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int[][] Bld1=new int[3][10]; Bld1 new int[3][10] 3 10 int[][] Bld2=new int[3][10]; Bld2 new int[3][10] 3 10 int[][] Bld3=new int[3][10]; Bld3 new int[3][10] 3 10 int[][] Bld4=new int[3][10]; Bld4 new int[3][10] 3 10 for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			Arrays.fill(Bld1[i], 0);} {
			Arrays.fill(Bld1[i], 0);} Arrays.fill(Bld1[i], 0) Arrays.fill Arrays Bld1[i] Bld1 i 0 for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			Arrays.fill(Bld2[i], 0);} {
			Arrays.fill(Bld2[i], 0);} Arrays.fill(Bld2[i], 0) Arrays.fill Arrays Bld2[i] Bld2 i 0 for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			Arrays.fill(Bld3[i], 0);} {
			Arrays.fill(Bld3[i], 0);} Arrays.fill(Bld3[i], 0) Arrays.fill Arrays Bld3[i] Bld3 i 0 for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			Arrays.fill(Bld4[i], 0);} {
			Arrays.fill(Bld4[i], 0);} Arrays.fill(Bld4[i], 0) Arrays.fill Arrays Bld4[i] Bld4 i 0 int Bld_num Bld_num floor floor room room volume; volume try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		} catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		} InputMismatchException e {
			System.out.println("??¨??????"+e);
		} System.out.println("??¨??????"+e) System.out.println System.out System System.out "??¨??????"+e "??¨??????" e {
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		} int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		} {
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		} Bld_num=scan.nextInt() Bld_num scan.nextInt() scan.nextInt scan floor=scan.nextInt() floor scan.nextInt() scan.nextInt scan room=scan.nextInt() room scan.nextInt() scan.nextInt scan volume=scan.nextInt() volume scan.nextInt() scan.nextInt scan switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			} Bld_num case 1: 1 case 1: Bld1[floor-1][room-1]+=volume Bld1[floor-1][room-1] Bld1[floor-1] Bld1 floor-1 floor 1 room-1 room 1 volume break; case 2: 2 case 2: Bld2[floor-1][room-1]+=volume Bld2[floor-1][room-1] Bld2[floor-1] Bld2 floor-1 floor 1 room-1 room 1 volume break; case 3: 3 case 3: Bld3[floor-1][room-1]+=volume Bld3[floor-1][room-1] Bld3[floor-1] Bld3 floor-1 floor 1 room-1 room 1 volume break; case 4: 4 case 4: Bld4[floor-1][room-1]+=volume Bld4[floor-1][room-1] Bld4[floor-1] Bld4 floor-1 floor 1 room-1 room 1 volume break; for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+Bld1[i][j]);
			} {
				System.out.print(" "+Bld1[i][j]);
			} System.out.print(" "+Bld1[i][j]) System.out.print System.out System System.out " "+Bld1[i][j] " " Bld1[i][j] Bld1[i] Bld1 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+Bld2[i][j]);
			} {
				System.out.print(" "+Bld2[i][j]);
			} System.out.print(" "+Bld2[i][j]) System.out.print System.out System System.out " "+Bld2[i][j] " " Bld2[i][j] Bld2[i] Bld2 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+Bld3[i][j]);
			} {
				System.out.print(" "+Bld3[i][j]);
			} System.out.print(" "+Bld3[i][j]) System.out.print System.out System System.out " "+Bld3[i][j] " " Bld3[i][j] Bld3[i] Bld3 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		} {
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		} for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+Bld4[i][j]);
			} {
				System.out.print(" "+Bld4[i][j]);
			} System.out.print(" "+Bld4[i][j]) System.out.print System.out System System.out " "+Bld4[i][j] " " Bld4[i][j] Bld4[i] Bld4 i j System.out.println() System.out.println System.out System System.out scan.close() scan.close scan String[] args args public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	}

} public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	}

} Main
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;



public class Main{


	public static void main(String[] args){

		Scanner scan=new Scanner(System.in);

		//SHDC?????????????????????????????????
		int[][] Bld1=new int[3][10];
		int[][] Bld2=new int[3][10];
		int[][] Bld3=new int[3][10];
		int[][] Bld4=new int[3][10];

		for(int i=0;i<3;i++){
			Arrays.fill(Bld1[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld2[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld3[i], 0);}
		for(int i=0;i<3;i++){
			Arrays.fill(Bld4[i], 0);}

		int Bld_num, floor,room,volume;

		try{
		int n=scan.nextInt();//n?????????

		for(int i=0;i<n;i++){
			Bld_num=scan.nextInt();
			floor=scan.nextInt();
			room=scan.nextInt();
			volume=scan.nextInt();



			switch(Bld_num){//???????????????????????????????????¨????????????1?????£??\???

			case 1:
				Bld1[floor-1][room-1]+=volume;
				break;
			case 2:
				Bld2[floor-1][room-1]+=volume;
				break;
			case 3:
				Bld3[floor-1][room-1]+=volume;
				break;
			case 4:
				Bld4[floor-1][room-1]+=volume;
				break;
			}
		}



		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld1[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld2[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld3[i][j]);
			}System.out.println();
		}

		System.out.println("####################");

		for(int i=0;i<3;i++){
			for(int j=0;j<10;j++){
				System.out.print(" "+Bld4[i][j]);
			}System.out.println();
		}


		scan.close();

		}catch(InputMismatchException e){
			System.out.println("??¨??????"+e);
		}


	}

}