import java.util.Arrays;
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner scn = new Scanner(System.in);
        int [][][] office = new int[4][3][10];
        int b=0,f=0,r=0,v=0,count=0;
        
        
        int n=scn.nextInt();
        for(int i=0;i<n;i++){
            b=scn.nextInt();
            f=scn.nextInt();
            r=scn.nextInt();
            v=scn.nextInt();
            office[b-1][f-1][r-1]+=v;
          
        }
        
        build(0,office);
        build(1,office);
        build(2,office);
        build(3,office);
        
    }


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


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


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


    private static void build(int count_b, int [][][] office_b) {
       for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                if(office_b[count_b][i][j]==0){
                    System.out.print(" "+0);
                }else{
                    System.out.print(" "+office_b[count_b][i][j]);
                }
                                
            }
        
                System.out.println("");
           
       }
       if(count_b!=3){
           System.out.println("####################");
       }
    }
    
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner scn = new Scanner(System.in);
        int [][][] office = new int[4][3][10];
        int b=0,f=0,r=0,v=0,count=0;
        
        
        int n=scn.nextInt();
        for(int i=0;i<n;i++){
            b=scn.nextInt();
            f=scn.nextInt();
            r=scn.nextInt();
            v=scn.nextInt();
            office[b-1][f-1][r-1]+=v;
          
        }
        
        build(0,office);
        build(1,office);
        build(2,office);
        build(3,office);
        
    }


    private static void build(int count_b, int [][][] office_b) {
       for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                if(office_b[count_b][i][j]==0){
                    System.out.print(" "+0);
                }else{
                    System.out.print(" "+office_b[count_b][i][j]);
                }
                                
            }
        
                System.out.println("");
           
       }
       if(count_b!=3){
           System.out.println("####################");
       }
    }
    
}