import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Integer[][][] building = new Integer[4][3][10]; building new Integer[4][3][10] 4 3 10 int b; b int f; f int r; r int v; v for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		} {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		} for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			} {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			} for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				} int j2 = 0; int j2 = 0; j2 0 j2 < 10 j2 10 j2++ j2++ j2 {
					building[i][j][j2]=0;
				} {
					building[i][j][j2]=0;
				} building[i][j][j2]=0 building[i][j][j2] building[i][j] building[i] building i j j2 0 for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		} {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		} b=sc.nextInt()-1 b sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 f=sc.nextInt()-1 f sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 r=sc.nextInt()-1 r sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 v=sc.nextInt() v sc.nextInt() sc.nextInt sc building[b][f][r] += v building[b][f][r] building[b][f] building[b] building b f r v for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			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 j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		} {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		} for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			} {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			} for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				} int j2 = 0; int j2 = 0; j2 0 j2 < 10 j2 10 j2++ j2++ j2 {
					System.out.print(" "+building[i][j][j2]);
				} {
					System.out.print(" "+building[i][j][j2]);
				} System.out.print(" "+building[i][j][j2]) System.out.print System.out System System.out " "+building[i][j][j2] " " building[i][j][j2] building[i][j] building[i] building i j j2 System.out.println() System.out.println System.out System System.out if(i!=3){
			System.out.println("####################");
			} i!=3 i 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) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	}
} Main
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); //??\??????????£??????°
		Integer[][][] building = new Integer[4][3][10];		
		int b;					//b?£?
		int f;					//f???
		int r;					//r???????????¨?±?
		int v;					//v?????\?±?
		
		//?????????
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					building[i][j][j2]=0;
				}
			}
		}
		
		//??\???
		for (int i = 0; i < n; i++) {
			b=sc.nextInt()-1;
			f=sc.nextInt()-1;
			r=sc.nextInt()-1;
			v=sc.nextInt();
			
			building[b][f][r] += v;
		}
		
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int j2 = 0; j2 < 10; j2++) {
					System.out.print(" "+building[i][j][j2]);
				}
				//??????
				System.out.println();
			}
			//????£??????????????????????
			if(i!=3){
			System.out.println("####################");
			}
		}
	}
}