import java.util.Scanner;
 
class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
 
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        }
 
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
 
        for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
         
                
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
        
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
 
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        }
 
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
 
        for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
         
                
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
        
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
 
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        }
 
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
 
        for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
         
                
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
        
    } main {
        Scanner scan = new Scanner(System.in);
 
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        }
 
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
 
        for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
         
                
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int [][][] build = new int [4][3][10]; build new int [4][3][10] 4 3 10 int tatemon tatemon floo floo roo; roo for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        } tatemon = 0; tatemon = 0 tatemon 0 tatemon < 4 tatemon 4 tatemon++ tatemon++ tatemon {
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        } {
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        } for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            } floo = 0; floo = 0 floo 0 floo < 3 floo 3 floo++ floo++ floo {
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            } {
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            } for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                } roo = 0; roo = 0 roo 0 roo < 10 roo 10 roo++ roo++ roo {
 
                build [tatemon][floo][roo] = 0;
 
                } {
 
                build [tatemon][floo][roo] = 0;
 
                } build [tatemon][floo][roo] = 0 build [tatemon][floo][roo] build [tatemon][floo] build [tatemon] build tatemon floo roo 0 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int tatemono = 0; tatemono 0 int floor= 0; floor 0 int room = 0; room 0 int info info person; person String result; result for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        } info = 0; info = 0 info 0 info < n info n info++ info++ info {
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        } {
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        } tatemono = scan.nextInt() tatemono scan.nextInt() scan.nextInt scan floor = scan.nextInt() floor scan.nextInt() scan.nextInt scan room = scan.nextInt() room scan.nextInt() scan.nextInt scan person = scan.nextInt() person scan.nextInt() scan.nextInt scan build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person build [tatemono-1][floor-1][room-1] build [tatemono-1][floor-1] build [tatemono-1] build tatemono-1 tatemono 1 floor-1 floor 1 room-1 room 1 build [tatemono-1][floor-1][room-1]+person build [tatemono-1][floor-1][room-1] build [tatemono-1][floor-1] build [tatemono-1] build tatemono-1 tatemono 1 floor-1 floor 1 room-1 room 1 person for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        } tatemon = 0; tatemon = 0 tatemon 0 tatemon < 4 tatemon 4 tatemon++ tatemon++ tatemon {
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        } {
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        } for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            } floo = 0; floo = 0 floo 0 floo < 3 floo 3 floo++ floo++ floo {
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            } {
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            } for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                } roo = 0; roo = 0 roo 0 roo < 10 roo 10 roo++ roo++ roo { 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                } { 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                } result = " "+build [tatemon][floo][roo] result " "+build [tatemon][floo][roo] " " build [tatemon][floo][roo] build [tatemon][floo] build [tatemon] build tatemon floo roo switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } tatemono case 1: 1 case 1: System.out.print(result) System.out.print System.out System System.out result break; case 2: 2 case 2: System.out.print(result) System.out.print System.out System System.out result break; case 3: 3 case 3: System.out.print(result) System.out.print System.out System System.out result break; case 4: 4 case 4: System.out.print(result) System.out.print System.out System System.out result break; default: default: System.out.println() System.out.println System.out System System.out if(tatemon < 3){
            System.out.println("####################");
            } tatemon < 3 tatemon 3 {
            System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args
import java.util.Scanner;
 
class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
 
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
 
                build [tatemon][floo][roo] = 0;
 
                }
            }
        }
 
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
 
        for(info = 0; info < n; info++){
                    
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
         
                
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                     
                result = " "+build [tatemon][floo][roo];
                     
                switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } 
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
        
    }
}