import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,j,k,n,b,f,r,v;
        int build[][][]=new int[4][3][10];
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			build[i][j][k]=0;
        		}
        	}
        }
        n=scan.nextInt();
        for(i=0;i<n;i++){
        	b=scan.nextInt()-1;
        	f=scan.nextInt()-1;
        	r=scan.nextInt()-1;
        	v=scan.nextInt();
        	build[b][f][r]+=v;
        }
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			if(k==9){
        				System.out.println(" "+ build[i][j][k]);
        			}
        			else{
        				System.out.print(" " + build[i][j][k]);
        			}
        		}
        	}
        	if(i!=3){
        		System.out.println("####################");
        	}
        }
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

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

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

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,j,k,n,b,f,r,v;
        int build[][][]=new int[4][3][10];
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			build[i][j][k]=0;
        		}
        	}
        }
        n=scan.nextInt();
        for(i=0;i<n;i++){
        	b=scan.nextInt()-1;
        	f=scan.nextInt()-1;
        	r=scan.nextInt()-1;
        	v=scan.nextInt();
        	build[b][f][r]+=v;
        }
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			if(k==9){
        				System.out.println(" "+ build[i][j][k]);
        			}
        			else{
        				System.out.print(" " + build[i][j][k]);
        			}
        		}
        	}
        	if(i!=3){
        		System.out.println("####################");
        	}
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,j,k,n,b,f,r,v;
        int build[][][]=new int[4][3][10];
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			build[i][j][k]=0;
        		}
        	}
        }
        n=scan.nextInt();
        for(i=0;i<n;i++){
        	b=scan.nextInt()-1;
        	f=scan.nextInt()-1;
        	r=scan.nextInt()-1;
        	v=scan.nextInt();
        	build[b][f][r]+=v;
        }
        for(i=0;i<4;i++){
        	for(j=0;j<3;j++){
        		for(k=0;k<10;k++){
        			if(k==9){
        				System.out.println(" "+ build[i][j][k]);
        			}
        			else{
        				System.out.print(" " + build[i][j][k]);
        			}
        		}
        	}
        	if(i!=3){
        		System.out.println("####################");
        	}
        }
    }
}

