import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	}
} 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();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int kousya[][][] = new int[4][3][10]; kousya new int[4][3][10] 4 3 10 for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		} int cnt1 = 0; int cnt1 = 0; cnt1 0 cnt1 < 4 cnt1 4 cnt1++ cnt1++ cnt1 {//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		} {//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		} for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			} int cnt2 = 0; int cnt2 = 0; cnt2 0 cnt2 < 3 cnt2 3 cnt2++ cnt2++ cnt2 {
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			} {
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			} for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				} int cnt3 = 0; int cnt3 = 0; cnt3 0 cnt3 < 10 cnt3 10 cnt3++ cnt3++ cnt3 {
					kousya[cnt1][cnt2][cnt3] = 0;
				} {
					kousya[cnt1][cnt2][cnt3] = 0;
				} kousya[cnt1][cnt2][cnt3] = 0 kousya[cnt1][cnt2][cnt3] kousya[cnt1][cnt2] kousya[cnt1] kousya cnt1 cnt2 cnt3 0 for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		} int cnt_n = 0; int cnt_n = 0; cnt_n 0 cnt_n < n cnt_n n cnt_n++ cnt_n++ cnt_n {//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		} {//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		} int house = scan.nextInt(); house 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 nin = scan.nextInt(); nin scan.nextInt() scan.nextInt scan kousya[house - 1][floor - 1][room - 1] += nin kousya[house - 1][floor - 1][room - 1] kousya[house - 1][floor - 1] kousya[house - 1] kousya house - 1 house 1 floor - 1 floor 1 room - 1 room 1 nin for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			} int cnt1 = 0; int cnt1 = 0; cnt1 0 cnt1 < 4 cnt1 4 cnt1++ cnt1++ cnt1 {//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			} {//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			} for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				} int cnt2 = 0; int cnt2 = 0; cnt2 0 cnt2 < 3 cnt2 3 cnt2++ cnt2++ cnt2 {
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				} {
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				} for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					} int cnt3 = 0; int cnt3 = 0; cnt3 0 cnt3 < 10 cnt3 10 cnt3++ cnt3++ cnt3 {
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					} {
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					} System.out.print(" " + kousya[cnt1][cnt2][cnt3]) System.out.print System.out System System.out " " + kousya[cnt1][cnt2][cnt3] " " kousya[cnt1][cnt2][cnt3] kousya[cnt1][cnt2] kousya[cnt1] kousya cnt1 cnt2 cnt3 System.out.println() System.out.println System.out System System.out if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				} cnt1 != 3 cnt1 3 {//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				} 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);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	}
} public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	}
} Main
import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();//n?????\?????????????????±?????°
		int kousya[][][] = new int[4][3][10];
		for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya???????????????????????????
			for(int cnt2 = 0; cnt2 < 3; cnt2++){
				for(int cnt3 = 0; cnt3 < 10; cnt3++){
					kousya[cnt1][cnt2][cnt3] = 0;
				}
			}
		}
		for(int cnt_n = 0; cnt_n < n; cnt_n++){//??°????????\?????????
			int house = scan.nextInt();//?£?
			int floor = scan.nextInt();//?£????????????¢
			int room = scan.nextInt();//????????¢?????????
			int nin = scan.nextInt();//??????????????°????¢??????°
			kousya[house - 1][floor - 1][room - 1] += nin;//??????????????°?¢???????????????????
		}	

			for(int cnt1 = 0; cnt1 < 4; cnt1++){//kousya??????????????????
				for(int cnt2 = 0; cnt2 < 3; cnt2++){
					for(int cnt3 = 0; cnt3 < 10; cnt3++){
						System.out.print(" " + kousya[cnt1][cnt2][cnt3]);
					}
					System.out.println();
				}
				if(cnt1 != 3){//??????????£???\????????????????????????????????????#????????\??????
					System.out.println("####################");
				}
			}
			scan.close();
	}
}