import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		int[][][] house = new int[4][3][10];
		String[] str;
		int building,floor,room,people;

		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		}
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}

	}
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		int[][][] house = new int[4][3][10];
		String[] str;
		int building,floor,room,people;

		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		}
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}

	}
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		int[][][] house = new int[4][3][10];
		String[] str;
		int building,floor,room,people;

		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		}
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}

	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		int[][][] house = new int[4][3][10];
		String[] str;
		int building,floor,room,people;

		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		}
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}

	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(buf.readLine()); n Integer.parseInt(buf.readLine()) Integer.parseInt Integer buf.readLine() buf.readLine buf int[][][] house = new int[4][3][10]; house new int[4][3][10] 4 3 10 String[] str; str int building building floor floor room room people; people for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 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 k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		} {
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		} for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			} {
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			} for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					house[i][j][k] = 0;
				} {
					house[i][j][k] = 0;
				} house[i][j][k] = 0 house[i][j][k] house[i][j] house[i] house i j k 0 for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-1][floor-1][room-1] += people;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-1][floor-1][room-1] += people;
		} {
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-1][floor-1][room-1] += people;
		} str = buf.readLine().split(" ") str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " building = Integer.parseInt(str[0]) building Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 floor = Integer.parseInt(str[1]) floor Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 room = Integer.parseInt(str[2]) room Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 people = Integer.parseInt(str[3]) people Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 house[building-1][floor-1][room-1] += people house[building-1][floor-1][room-1] house[building-1][floor-1] house[building-1] house building-1 building 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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					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 k=0; k<10; k++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		} {
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		} for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			} {
				for(int k=0; k<10; k++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			} for(int k=0; k<10; k++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				} {
					//printf???print???????????????????????????????????????
					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.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 System System.out "####################" String args[] args
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(buf.readLine());
		int[][][] house = new int[4][3][10];
		String[] str;
		int building,floor,room,people;

		for(int i=0; i<4; i++){
			for(int j=0; j<3; j++){
				for(int k=0; k<10; k++){
					house[i][j][k] = 0;
				}
			}
		}
		for(int i=0; i<n; i++){
			str = buf.readLine().split(" ");
			building = Integer.parseInt(str[0]);
			floor = Integer.parseInt(str[1]);
			room = Integer.parseInt(str[2]);
			people = Integer.parseInt(str[3]);
			//?????°???????????????????????´???????????§???+=?????????
			house[building-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++){
					//printf???print???????????????????????????????????????
					System.out.print(" "+house[i][j][k]);
				}
				//if(!(i==3 && j==2))
					System.out.println();
			}
			if(i<3)
				System.out.println("####################");
		}

	}
}