import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} Main public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	} main {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	} BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) ); kb new BufferedReader( new InputStreamReader( System.in ) ) try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		} catch( IOException e ) {
			System.err.println( e );
		} IOException e {
			System.err.println( e );
		} System.err.println( e ) System.err.println System.err System System.err e {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} String str = kb.readLine(); str kb.readLine() kb.readLine kb int n = Integer.parseInt( str ); n Integer.parseInt( str ) Integer.parseInt Integer str int[][][] oHouse= new int[5][4][11]; oHouse new int[5][4][11] 5 4 11 int[] tnum= new int[5]; tnum new int[5] 5 String[] tmpArray; tmpArray for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			} {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			} str = kb.readLine() str kb.readLine() kb.readLine kb tmpArray = str.split( " " ) tmpArray str.split( " " ) str.split str " " for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				} int j=0; int j=0; j 0 j<4 j 4 j++ j++ j {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				} {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				} tnum[j]=Integer.parseInt( tmpArray[j] ) tnum[j] tnum j Integer.parseInt( tmpArray[j] ) Integer.parseInt Integer tmpArray[j] tmpArray j oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3] oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] oHouse[ tnum[0]-1 ][ tnum[1]-1 ] oHouse[ tnum[0]-1 ] oHouse tnum[0]-1 tnum[0] tnum 0 1 tnum[1]-1 tnum[1] tnum 1 1 tnum[2]-1 tnum[2] tnum 2 1 tnum[3] tnum 3 for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					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++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			} {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			} for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				} {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				} for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
						System.out.print( " " + oHouse[i][j][k] );	
					} {
						System.out.print( " " + oHouse[i][j][k] );	
					} System.out.print( " " + oHouse[i][j][k] ) System.out.print System.out System System.out " " + oHouse[i][j][k] " " oHouse[i][j][k] oHouse[i][j] oHouse[i] oHouse i j k System.out.print( "\n" ) System.out.print System.out System System.out "\n" if( 3 != i ) {
					System.out.println( "####################" );	
				} 3 != i 3 i {
					System.out.println( "####################" );	
				} 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) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
			String str = kb.readLine();
			int n = Integer.parseInt( str );
			
			int[][][] oHouse= new int[5][4][11];
			int[] tnum= new int[5];
			String[] tmpArray;
			for( int i=0; i<n; i++ ) {
				str = kb.readLine();
				tmpArray = str.split( " " );
				for( int j=0; j<4; j++ ) {
					tnum[j]=Integer.parseInt( tmpArray[j] );
				}
				oHouse[ tnum[0]-1 ][ tnum[1]-1 ][ tnum[2]-1 ] += tnum[3];
			}
			for( int i=0; i<4; i++ ) {
				for( int j=0; j<3; j++ ) {
					for( int k=0; k<10; k++ ) {
						System.out.print( " " + oHouse[i][j][k] );	
					}
					System.out.print( "\n" );	
				}
				if( 3 != i ) {
					System.out.println( "####################" );	
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
}