import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	}
} Main public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	} main {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	} int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 int n = 0; n 0 int b = 0; b 0 int f = 0; f 0 int r = 0; r 0 int v = 0; v 0 for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	} int i = 0 ; int i = 0 ; i 0 i < room.length i room.length room room.length i++ i++ i {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	} {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	} for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		} int j = 0 ; int j = 0 ; j 0 j <room[i].length j room[i].length room[i] room i room[i].length j++ j++ j {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		} {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		} for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		} int k = 0 ; int k = 0 ; k 0 k < room[i][j].length k room[i][j].length room[i][j] room[i] room i j room[i][j].length k++ k++ k {
        			room[i][j][k] = 0;
        		} {
        			room[i][j][k] = 0;
        		} room[i][j][k] = 0 room[i][j][k] room[i][j] room[i] room i j k 0 Scanner sc= new Scanner( System.in ); sc new Scanner( System.in ) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	} {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	} b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc 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 < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	} int i = 0 ; int i = 0 ; i 0 i < room.length i room.length room room.length i++ i++ i {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	} {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	} for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		} int j = 0 ; int j = 0 ; j 0 j <room[i].length j room[i].length room[i] room i room[i].length j++ j++ j {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		} {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		} for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		} int k = 0 ; int k = 0 ; k 0 k < room[i][j].length k room[i][j].length room[i][j] room[i] room i j room[i][j].length k++ k++ k {
    				System.out.print( " " + room[i][j][k] );
        		} {
    				System.out.print( " " + room[i][j][k] );
        		} System.out.print( " " + room[i][j][k] ) System.out.print System.out System System.out " " + room[i][j][k] " " room[i][j][k] room[i][j] room[i] room i j k System.out.print( "\n" ) System.out.print System.out System System.out "\n" if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		} i != room.length-1 i room.length-1 room.length room room.length 1 {
				System.out.println( "####################" );
    		} System.out.println( "####################" ) System.out.println System.out System System.out "####################" sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int[][][] room = new int[4][3][10];
		int n = 0;
		int b = 0;
		int f = 0;
		int r = 0;
		int v = 0;

    	//初期化
    	for( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
        			room[i][j][k] = 0;
        		}
    		}

    	}

    	Scanner sc= new Scanner( System.in );
    	n = sc.nextInt();

    	for ( int i = 0 ; i < n ; i++ ) {
        	b = sc.nextInt();
        	f = sc.nextInt();
        	r = sc.nextInt();
        	v = sc.nextInt();

        	room[b-1][f-1][r-1] += v;

    	}

    	for ( int i = 0 ; i < room.length ; i++ ) {
    		for ( int j = 0 ; j <room[i].length ; j++ ) {
        		for ( int k = 0 ; k < room[i][j].length ; k++ ) {
    				System.out.print( " " + room[i][j][k] );
        		}
				System.out.print( "\n" );
    		}
    		if ( i != room.length-1 ) {
				System.out.println( "####################" );
    		}
    	}
    	sc.close();
	}
}
