import java.util.Scanner;

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

		int b,f,r,v;
		int[][][] room = new int[4][3][10]; //b-1,f-1,r-1
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		}

		Scanner sc = new Scanner(System.in);
		int n =Integer.parseInt(sc.nextLine());
		for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		}
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		}
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){

		int b,f,r,v;
		int[][][] room = new int[4][3][10]; //b-1,f-1,r-1
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		}

		Scanner sc = new Scanner(System.in);
		int n =Integer.parseInt(sc.nextLine());
		for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		}
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		}
	}
} Main public static void main(String[] args){

		int b,f,r,v;
		int[][][] room = new int[4][3][10]; //b-1,f-1,r-1
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		}

		Scanner sc = new Scanner(System.in);
		int n =Integer.parseInt(sc.nextLine());
		for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		}
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		}
	} main {

		int b,f,r,v;
		int[][][] room = new int[4][3][10]; //b-1,f-1,r-1
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		}

		Scanner sc = new Scanner(System.in);
		int n =Integer.parseInt(sc.nextLine());
		for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		}
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		}
	} int b b f f r r v; v int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=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 t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		} {
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		} for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			} {
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			} for(int t=0;t<10;t++){
					room[i][j][t]=0;
				} int t=0; int t=0; t 0 t<10 t 10 t++ t++ t {
					room[i][j][t]=0;
				} {
					room[i][j][t]=0;
				} room[i][j][t]=0 room[i][j][t] room[i][j] room[i] room i j t 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n =Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		} {
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		} String[] line=sc.nextLine().split(" "); line sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " b=Integer.parseInt(line[0])-1 b Integer.parseInt(line[0])-1 Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 1 f=Integer.parseInt(line[1])-1 f Integer.parseInt(line[1])-1 Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 1 r=Integer.parseInt(line[2])-1 r Integer.parseInt(line[2])-1 Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 1 v=Integer.parseInt(line[3]) v Integer.parseInt(line[3]) Integer.parseInt Integer line[3] line 3 room[b][f][r]=room[b][f][r]+v room[b][f][r] room[b][f] room[b] room b f r room[b][f][r]+v room[b][f][r] room[b][f] room[b] room b f r v for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				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 t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		} {
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		} for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			} {
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			} for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				} int t=0; int t=0; t 0 t<10 t 10 t++ t++ t {
					System.out.print(" "+room[i][j][t]);
				} {
					System.out.print(" "+room[i][j][t]);
				} System.out.print(" "+room[i][j][t]) System.out.print System.out System System.out " "+room[i][j][t] " " room[i][j][t] room[i][j] room[i] room i j t System.out.println() System.out.println System.out System System.out if(!(i==3)){
				System.out.println("####################");
			} !(i==3) (i==3) i 3 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.util.Scanner;

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

		int b,f,r,v;
		int[][][] room = new int[4][3][10]; //b-1,f-1,r-1
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					room[i][j][t]=0;
				}
			}
		}

		Scanner sc = new Scanner(System.in);
		int n =Integer.parseInt(sc.nextLine());
		for(int i=0;i<n;i++){
			String[] line=sc.nextLine().split(" ");
			b=Integer.parseInt(line[0])-1;
			f=Integer.parseInt(line[1])-1;
			r=Integer.parseInt(line[2])-1;
			v=Integer.parseInt(line[3]);
			room[b][f][r]=room[b][f][r]+v;
		}
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++){
				for(int t=0;t<10;t++){
					System.out.print(" "+room[i][j][t]);
				}
				System.out.println();
			}
			if(!(i==3)){
				System.out.println("####################");
			}
		}
	}
}