import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	}
} Main public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	} main {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n n b b f f r r v; v int data1[][] = new int[3][10]; data1 new int[3][10] 3 10 int data2[][] = new int[3][10]; data2 new int[3][10] 3 10 int data3[][] = new int[3][10]; data3 new int[3][10] 3 10 int data4[][] = new int[3][10]; data4 new int[3][10] 3 10 for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		} {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		} for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			} int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			} {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			} data1[i][j] = 0 data1[i][j] data1[i] data1 i j 0 data2[i][j] = 0 data2[i][j] data2[i] data2 i j 0 data3[i][j] = 0 data3[i][j] data3[i] data3 i j 0 data4[i][j] = 0 data4[i][j] data4[i] data4 i j 0 n = scan.nextInt() n scan.nextInt() scan.nextInt scan for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		} {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			} b case 1: 1 case 1: data1[f - 1][r - 1] += v data1[f - 1][r - 1] data1[f - 1] data1 f - 1 f 1 r - 1 r 1 v break; case 2: 2 case 2: data2[f - 1][r - 1] += v data2[f - 1][r - 1] data2[f - 1] data2 f - 1 f 1 r - 1 r 1 v break; case 3: 3 case 3: data3[f - 1][r - 1] += v data3[f - 1][r - 1] data3[f - 1] data3 f - 1 f 1 r - 1 r 1 v break; case 4: 4 case 4: data4[f - 1][r - 1] += v data4[f - 1][r - 1] data4[f - 1] data4 f - 1 f 1 r - 1 r 1 v break; default: default: break; for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		} 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++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		} {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		} for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			} {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			} for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				} {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				} switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					} i case 0: 0 case 0: if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						} k == 9 k 9 {
							System.out.println(" " + data1[j][k]);
						} System.out.println(" " + data1[j][k]) System.out.println System.out System System.out " " + data1[j][k] " " data1[j][k] data1[j] data1 j k {
							System.out.print(" " + data1[j][k]);
						} System.out.print(" " + data1[j][k]) System.out.print System.out System System.out " " + data1[j][k] " " data1[j][k] data1[j] data1 j k break; case 1: 1 case 1: if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						} k == 9 k 9 {
							System.out.println(" " + data2[j][k]);
						} System.out.println(" " + data2[j][k]) System.out.println System.out System System.out " " + data2[j][k] " " data2[j][k] data2[j] data2 j k {
							System.out.print(" " + data2[j][k]);
						} System.out.print(" " + data2[j][k]) System.out.print System.out System System.out " " + data2[j][k] " " data2[j][k] data2[j] data2 j k break; case 2: 2 case 2: if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						} k == 9 k 9 {
							System.out.println(" " + data3[j][k]);
						} System.out.println(" " + data3[j][k]) System.out.println System.out System System.out " " + data3[j][k] " " data3[j][k] data3[j] data3 j k {
							System.out.print(" " + data3[j][k]);
						} System.out.print(" " + data3[j][k]) System.out.print System.out System System.out " " + data3[j][k] " " data3[j][k] data3[j] data3 j k break; case 3: 3 case 3: if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						} k == 9 k 9 {
							System.out.println(" " + data4[j][k]);
						} System.out.println(" " + data4[j][k]) System.out.println System.out System System.out " " + data4[j][k] " " data4[j][k] data4[j] data4 j k {
							System.out.print(" " + data4[j][k]);
						} System.out.print(" " + data4[j][k]) System.out.print System.out System System.out " " + data4[j][k] " " data4[j][k] data4[j] data4 j k break; default: default: break; if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			} i != 3 i 3 {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			} for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				} int m = 0; int m = 0; m 0 m < 20 m 20 m++ m++ m {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				} {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				} if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					} m == 19 m 19 {
						System.out.println("#");
					} System.out.println("#") System.out.println System.out System System.out "#" {
						System.out.print("#");
					} System.out.print("#") System.out.print System.out System System.out "#" String [] args args public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	}
} public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		Scanner scan = new Scanner(System.in);
		int n, b, f, r, v;
		int data1[][] = new int[3][10];
		int data2[][] = new int[3][10];
		int data3[][] = new int[3][10];
		int data4[][] = new int[3][10];
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 10; j++) {
				data1[i][j] = 0;
				data2[i][j] = 0;
				data3[i][j] = 0;
				data4[i][j] = 0;
			}
		}
		
		n = scan.nextInt();
		
		for(int i = 1; i <= n; i++) {
			b = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			v = scan.nextInt();
			
			switch(b) {
			case 1:
				data1[f - 1][r - 1] += v; 
				break;
			case 2:
				data2[f - 1][r - 1] += v; 
				break;
			case 3:
				data3[f - 1][r - 1] += v; 
				break;
			case 4:
				data4[f - 1][r - 1] += v; 
				break;
			default:
				break;
			}
		}
		
		for( int i = 0; i < 4; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 10; k++) {
					switch(i) {
					case 0:
						if( k == 9) {
							System.out.println(" " + data1[j][k]);
						}else {
							System.out.print(" " + data1[j][k]);
						}
						break;
					case 1:
						if( k == 9) {
							System.out.println(" " + data2[j][k]);
						}else {
							System.out.print(" " + data2[j][k]);
						}
						break;
					case 2:
						if( k == 9) {
							System.out.println(" " + data3[j][k]);
						}else {
							System.out.print(" " + data3[j][k]);
						}
						break;
					case 3:
						if( k == 9) {
							System.out.println(" " + data4[j][k]);
						}else {
							System.out.print(" " + data4[j][k]);
						}
						break;
					default:
						break;
					}
				}
			}
			if( i != 3) {
				for( int m = 0; m < 20; m++) {
					if( m == 19) {
						System.out.println("#");
					}else {
						System.out.print("#");
					}
				}
			}
		}
		
		
	}
}
