import java.io.*;
import java.util.*;

class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Building[] building=new Building[4];
        for(int i=0;i<4;i++){
            building[i]=new Building();
        }
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        }
        for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        }building[3].show();

    }

}

class Building {

    Floor[] floor = new Floor[3];

    Building() {
        for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        }
    }
    
    void show(){
        for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        }
    }
    
}

class Floor {

    int[] room = new int[10];

    Floor() {
        Arrays.fill(room, 0);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Building[] building=new Building[4];
        for(int i=0;i<4;i++){
            building[i]=new Building();
        }
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        }
        for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        }building[3].show();

    }

} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Building[] building=new Building[4];
        for(int i=0;i<4;i++){
            building[i]=new Building();
        }
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        }
        for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        }building[3].show();

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Building[] building=new Building[4];
        for(int i=0;i<4;i++){
            building[i]=new Building();
        }
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        }
        for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        }building[3].show();

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) Building[] building=new Building[4]; building new Building[4] 4 for(int i=0;i<4;i++){
            building[i]=new Building();
        } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
            building[i]=new Building();
        } {
            building[i]=new Building();
        } building[i]=new Building() building[i] building i new Building() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        } {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        } StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int b = Integer.parseInt(st.nextToken()); b Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int f = Integer.parseInt(st.nextToken()); f Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int r = Integer.parseInt(st.nextToken()); r Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int v = Integer.parseInt(st.nextToken()); v Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st building[b-1].floor[f-1].room[r-1]+=v building[b-1].floor[f-1].room[r-1] building[b-1].floor[f-1].room building[b-1].floor[f-1] building[b-1].floor building[b-1] building b-1 b 1 building[b-1].floor f-1 f 1 building[b-1].floor[f-1].room r-1 r 1 v for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            building[i].show();
            System.out.println("####################");
        } {
            building[i].show();
            System.out.println("####################");
        } building[i].show() building[i].show building[i] building i System.out.println("####################") System.out.println System.out System System.out "####################" building[3].show() building[3].show building[3] building 3 String[] args args class Building {

    Floor[] floor = new Floor[3];

    Building() {
        for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        }
    }
    
    void show(){
        for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        }
    }
    
} Building Floor[] floor = new Floor[3]; floor new Floor[3] 3 Building() {
        for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        }
    } Building {
        for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        }
    } for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            floor[i] = new Floor();
        } {
            floor[i] = new Floor();
        } floor[i] = new Floor() floor[i] floor i new Floor() void show(){
        for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        }
    } show {
        for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        }
    } for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[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++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        } {
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        } for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
                System.out.print(" "+this.floor[i].room[j]);
            } {
                System.out.print(" "+this.floor[i].room[j]);
            } System.out.print(" "+this.floor[i].room[j]) System.out.print System.out System System.out " "+this.floor[i].room[j] " " this.floor[i].room[j] this.floor[i].room this.floor[i] this.floor this this.floor i this.floor[i].room j System.out.println() System.out.println System.out System System.out class Floor {

    int[] room = new int[10];

    Floor() {
        Arrays.fill(room, 0);
    }
} Floor int[] room = new int[10]; room new int[10] 10 Floor() {
        Arrays.fill(room, 0);
    } Floor {
        Arrays.fill(room, 0);
    } Arrays.fill(room, 0) Arrays.fill Arrays room 0
import java.io.*;
import java.util.*;

class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Building[] building=new Building[4];
        for(int i=0;i<4;i++){
            building[i]=new Building();
        }
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int b = Integer.parseInt(st.nextToken());
            int f = Integer.parseInt(st.nextToken());
            int r = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            building[b-1].floor[f-1].room[r-1]+=v;
        }
        for(int i=0;i<3;i++){
            building[i].show();
            System.out.println("####################");
        }building[3].show();

    }

}

class Building {

    Floor[] floor = new Floor[3];

    Building() {
        for (int i = 0; i < 3; i++) {
            floor[i] = new Floor();
        }
    }
    
    void show(){
        for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
                System.out.print(" "+this.floor[i].room[j]);
            }System.out.println();
        }
    }
    
}

class Floor {

    int[] room = new int[10];

    Floor() {
        Arrays.fill(room, 0);
    }
}