import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    }
}

class Building{
//    private int residents[][];
    private int floor=3;
    private int room=10;
    private int residents[][]=new int[floor][room];
    void Buidling(){
//        this.residents=new int[this.floor][this.room];
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        }
    }
    public void updateResidents(int f,int r,int v){
        this.residents[f][r]+=v;
    }
    public void output(){
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    }
} Main public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    } main {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    } Building B[]=new Building[4]; B new Building[4] 4 for(int i=0;i<4;i++)B[i]=new Building(); int i=0; int i=0; i 0 i<4 i 4 i++ i++ i B[i]=new Building(); B[i]=new Building() B[i] B i new Building() Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        } n-->0 n-- n 0 {
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        } B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt()) B[sc.nextInt()-1].updateResidents B[sc.nextInt()-1] B sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 sc.nextInt() sc.nextInt sc for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
            if(i!=0)System.out.println("####################");
            B[i].output();
        } {
            if(i!=0)System.out.println("####################");
            B[i].output();
        } if(i!=0)System.out.println("####################"); i!=0 i 0 System.out.println("####################") System.out.println System.out System System.out "####################" B[i].output() B[i].output B[i] B i String[] args args class Building{
//    private int residents[][];
    private int floor=3;
    private int room=10;
    private int residents[][]=new int[floor][room];
    void Buidling(){
//        this.residents=new int[this.floor][this.room];
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        }
    }
    public void updateResidents(int f,int r,int v){
        this.residents[f][r]+=v;
    }
    public void output(){
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        }
    }
} Building //    private int residents[][];
    private int floor=3; floor 3 private int room=10; room 10 private int residents[][]=new int[floor][room]; residents new int[floor][room] floor room void Buidling(){
//        this.residents=new int[this.floor][this.room];
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        }
    } Buidling {
//        this.residents=new int[this.floor][this.room];
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        }
    } for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        } int i=0; int i=0; i 0 i<this.floor i this.floor this this.floor i++ i++ i {
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        } {
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        } for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            } int j=0; int j=0; j 0 j<this.room j this.room this this.room j++ j++ j {
                this.residents[i][j]=0;
            } {
                this.residents[i][j]=0;
            } this.residents[i][j]=0 this.residents[i][j] this.residents[i] this.residents this this.residents i j 0 public void updateResidents(int f,int r,int v){
        this.residents[f][r]+=v;
    } updateResidents {
        this.residents[f][r]+=v;
    } this.residents[f][r]+=v this.residents[f][r] this.residents[f] this.residents this this.residents f r v int f f int r r int v v public void output(){
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        }
    } output {
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        }
    } for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        } int i=0; int i=0; i 0 i<this.floor i this.floor this this.floor i++ i++ i {
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        } {
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        } for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            } int j=0; int j=0; j 0 j<this.room j this.room this this.room j++ j++ j {
                System.out.printf(" %d",this.residents[i][j]);
            } {
                System.out.printf(" %d",this.residents[i][j]);
            } System.out.printf(" %d",this.residents[i][j]) System.out.printf System.out System System.out " %d" this.residents[i][j] this.residents[i] this.residents this this.residents i j System.out.printf("\n") System.out.printf System.out System System.out "\n" public class Main {
    public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Building B[]=new Building[4];
        for(int i=0;i<4;i++)B[i]=new Building();
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        while(n-->0){
            B[sc.nextInt()-1].updateResidents(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt());
        }
        for(int i=0;i<4;i++){
            if(i!=0)System.out.println("####################");
            B[i].output();
        }
    }
}

class Building{
//    private int residents[][];
    private int floor=3;
    private int room=10;
    private int residents[][]=new int[floor][room];
    void Buidling(){
//        this.residents=new int[this.floor][this.room];
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                this.residents[i][j]=0;
            }
        }
    }
    public void updateResidents(int f,int r,int v){
        this.residents[f][r]+=v;
    }
    public void output(){
        for(int i=0;i<this.floor;i++){
            for(int j=0;j<this.room;j++){
                System.out.printf(" %d",this.residents[i][j]);
            }
            System.out.printf("\n");
        }
    }
}
