import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				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 S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	}
} Main public static void main(String[] args){
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	} main {
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	} Scanner S = new Scanner(System.in); S new Scanner(System.in) int N = S.nextInt(); N S.nextInt() S.nextInt S int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		} int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		} {
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		} int b = S.nextInt(); b S.nextInt() S.nextInt S int f = S.nextInt(); f S.nextInt() S.nextInt S int r = S.nextInt(); r S.nextInt() S.nextInt S int v = S.nextInt(); v S.nextInt() S.nextInt S room[b - 1][f - 1][r - 1] += v room[b - 1][f - 1][r - 1] room[b - 1][f - 1] room[b - 1] room b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				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 s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		} {
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		} for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			} {
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			} for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				} int s = 0; int s = 0; s 0 s < 10 s 10 s++ s++ s {
					System.out.print(" "+room[i][j][s]);
				} {
					System.out.print(" "+room[i][j][s]);
				} System.out.print(" "+room[i][j][s]) System.out.print System.out System System.out " "+room[i][j][s] " " room[i][j][s] room[i][j] room[i] room i j s 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 public class Main{
	public static void main(String[] args){
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	}
} public class Main{
	public static void main(String[] args){
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner S = new Scanner(System.in);
		
		int N = S.nextInt();
		int[][][] room = new int[4][3][10];
		
		for(int i = 0;i< N;i++){
			int b = S.nextInt();
			int f = S.nextInt();
			int r = S.nextInt();
			int v = S.nextInt();
			
			room[b - 1][f - 1][r - 1] += v;
		}
		
		for(int i = 0;i < 4;i++){
			for(int j = 0;j < 3;j++){
				for(int s = 0;s < 10;s++){
					System.out.print(" "+room[i][j][s]);
				}
				System.out.println();
			}
			if(i != 3)
			System.out.println("####################");
		}	
	}
}