import java.util.Scanner;


public class Main {


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

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				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 n = scan.nextInt();
		int[][][] house = new int[4][3][10];

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	}

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

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[][][] house = new int[4][3][10];

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 for(int i=0;i<n;i++){
			int tou = scan.nextInt();
			int floor = scan.nextInt();
			int room = scan.nextInt();
			int people = scan.nextInt();

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int tou = scan.nextInt();
			int floor = scan.nextInt();
			int room = scan.nextInt();
			int people = scan.nextInt();

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		} {
			int tou = scan.nextInt();
			int floor = scan.nextInt();
			int room = scan.nextInt();
			int people = scan.nextInt();

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		} int tou = scan.nextInt(); tou scan.nextInt() scan.nextInt scan int floor = scan.nextInt(); floor scan.nextInt() scan.nextInt scan int room = scan.nextInt(); room scan.nextInt() scan.nextInt scan int people = scan.nextInt(); people scan.nextInt() scan.nextInt scan house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people house[tou-1][floor-1][room-1] house[tou-1][floor-1] house[tou-1] house tou-1 tou 1 floor-1 floor 1 room-1 room 1 house[tou-1][floor-1][room-1]+people house[tou-1][floor-1][room-1] house[tou-1][floor-1] house[tou-1] house tou-1 tou 1 floor-1 floor 1 room-1 room 1 people for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				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(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		} {
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		} for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			} {
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			} for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				} {
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				} if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					} house[i][j][k]>0 house[i][j][k] house[i][j] house[i] house i j k 0 {
						System.out.print(" "+house[i][j][k]);
					} System.out.print(" "+house[i][j][k]) System.out.print System.out System System.out " "+house[i][j][k] " " house[i][j][k] house[i][j] house[i] house i j k {
						System.out.print(" 0");
					} System.out.print(" 0") System.out.print System.out System System.out " 0" System.out.println() System.out.println System.out System System.out if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			} i!=3 i 3 {
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			} for(int j=0;j<20;j++){
					System.out.print("#");
				} int j=0; int j=0; j 0 j<20 j 20 j++ j++ j {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print 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 n = scan.nextInt();
		int[][][] house = new int[4][3][10];

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	}

} public class Main {


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

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	}

} Main
import java.util.Scanner;


public class Main {


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

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

			house[tou-1][floor-1][room-1]=house[tou-1][floor-1][room-1]+people;
		}

		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<10;k++){
					if(house[i][j][k]>0){
						System.out.print(" "+house[i][j][k]);
					}else{
						System.out.print(" 0");
					}
				}
				System.out.println();
			}
			if(i!=3){
				for(int j=0;j<20;j++){
					System.out.print("#");
				}
				System.out.println();
			}
		}

	}

}