import java.util.Scanner;

public class Main {
    private int[][][] numOfppl = new int[4][3][10];

    public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    }

    public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    }

    public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    }
    public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    private int[][][] numOfppl = new int[4][3][10];

    public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    }

    public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    }

    public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    }
    public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    }
} Main private int[][][] numOfppl = new int[4][3][10]; numOfppl new int[4][3][10] 4 3 10 public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    } initRoom {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    } for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            } {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            } for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    numOfppl[i][j][k] = 0;
                } {
                    numOfppl[i][j][k] = 0;
                } numOfppl[i][j][k] = 0 numOfppl[i][j][k] numOfppl[i][j] numOfppl[i] numOfppl i j k 0 public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    } addPpl {
        numOfppl[b][f][r] += v;
    } numOfppl[b][f][r] += v numOfppl[b][f][r] numOfppl[b][f] numOfppl[b] numOfppl b f r v int b b int f f int r r int v v public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    } printRoom {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    } for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            } for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.print(" " + numOfppl[i][j][k]);
                } {
                    System.out.print(" " + numOfppl[i][j][k]);
                } System.out.print(" " + numOfppl[i][j][k]) System.out.print System.out System System.out " " + numOfppl[i][j][k] " " numOfppl[i][j][k] numOfppl[i][j] numOfppl[i] numOfppl i j k System.out.print("\n") System.out.print System.out System System.out "\n" if (i != 3) System.out.println("####################"); i != 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    } main {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    } Main app = new Main(); app new Main() Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = Integer.parseInt(scan.next()); num Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan app.initRoom() app.initRoom app for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        } {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        } int b = Integer.parseInt(scan.next()) - 1; b Integer.parseInt(scan.next()) - 1 Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan 1 int f = Integer.parseInt(scan.next()) - 1; f Integer.parseInt(scan.next()) - 1 Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan 1 int r = Integer.parseInt(scan.next()) - 1; r Integer.parseInt(scan.next()) - 1 Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan 1 int v = Integer.parseInt(scan.next()); v Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan app.addPpl(b, f, r, v) app.addPpl app b f r v app.printRoom() app.printRoom app String[] args args public class Main {
    private int[][][] numOfppl = new int[4][3][10];

    public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    }

    public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    }

    public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    }
    public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    }
} public class Main {
    private int[][][] numOfppl = new int[4][3][10];

    public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    }

    public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    }

    public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    }
    public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    }
} Main
import java.util.Scanner;

public class Main {
    private int[][][] numOfppl = new int[4][3][10];

    public void  initRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    numOfppl[i][j][k] = 0;
                }
            }
        }
    }

    public void addPpl(int b, int f, int r, int v) {
        numOfppl[b][f][r] += v;
    }

    public void printRoom() {
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.print(" " + numOfppl[i][j][k]);
                }
                System.out.print("\n");
            }
            if (i != 3) System.out.println("####################");
        }

    }
    public static void main(String[] args) {
        Main app = new Main();
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());

        app.initRoom();
        for (int i = 0; i < num; i++) {
            int b = Integer.parseInt(scan.next()) - 1;
            int f = Integer.parseInt(scan.next()) - 1;
            int r = Integer.parseInt(scan.next()) - 1;
            int v = Integer.parseInt(scan.next());
            app.addPpl(b, f, r, v);
        }
        app.printRoom();
    }
}

