import java.util.Scanner;

/**
 * Official House
 */
public class Main {
    private static Scanner scan;
    // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10;
    private static final int Floor = 3;
    private static final int Building = 4;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static Scanner scan;
    // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10;
    private static final int Floor = 3;
    private static final int Building = 4;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    }
} Main private static Scanner scan; scan // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10; Room 10 private static final int Floor = 3; Floor 3 private static final int Building = 4; Building 4 public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    } main {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    } scan = new Scanner(System.in) scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[][][] count = new int[Building][Floor][Room]; count new int[Building][Floor][Room] Building Floor Room int b b f f r r v = 0; v 0 for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        } {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        } b = scan.nextInt() b scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan v = scan.nextInt() v scan.nextInt() scan.nextInt scan for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            } int p = 0; int p = 0; p 0 p < Building p Building p++ p++ p {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            } {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            } for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                } int q = 0; int q = 0; q 0 q < Floor q Floor q++ q++ q {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                } {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                } for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    } int x = 0; int x = 0; x 0 x < Room x Room x++ x++ x {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    } {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    } if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        } p + 1 == b && q + 1 == f && x + 1 == r p + 1 == b && q + 1 == f && x + 1 == r p + 1 == b p + 1 p 1 b q + 1 == f q + 1 q 1 f x + 1 == r x + 1 x 1 r {
                            count[p][q][x] += v;
                        } count[p][q][x] += v count[p][q][x] count[p][q] count[p] count p q x v for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        } int p = 0; int p = 0; p 0 p < Building p Building p++ p++ p {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        } {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        } for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            } int q = 0; int q = 0; q 0 q < Floor q Floor q++ q++ q {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            } {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            } for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                } int x = 0; int x = 0; x 0 x < Room x Room x++ x++ x {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                } {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(count[p][q][x]) System.out.print System.out System System.out count[p][q][x] count[p][q] count[p] count p q x System.out.print("\n") System.out.print System.out System System.out "\n" if (p < Building - 1) {
                System.out.println("####################");
            } p < Building - 1 p Building - 1 Building 1 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
    private static Scanner scan;
    // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10;
    private static final int Floor = 3;
    private static final int Building = 4;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    }
} public class Main {
    private static Scanner scan;
    // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10;
    private static final int Floor = 3;
    private static final int Building = 4;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    }
} Main
import java.util.Scanner;

/**
 * Official House
 */
public class Main {
    private static Scanner scan;
    // １フロア１０部屋、３階建ての公舎４棟
    private static final int Room = 10;
    private static final int Floor = 3;
    private static final int Building = 4;

    public static void main(String[] args) {
        scan = new Scanner(System.in);
        // n件の情報
        // b棟f階のr番目の部屋にv人
        int n = scan.nextInt();
        int[][][] count = new int[Building][Floor][Room];

        int b,f,r,v = 0;
        for (int i = 0; i < n; i++) {
            b = scan.nextInt();
            f = scan.nextInt();
            r = scan.nextInt();
            v = scan.nextInt();
            for (int p = 0; p < Building; p++) {
                for (int q = 0; q < Floor; q++) {
                    for (int x = 0; x < Room; x++) {
                        if (p + 1 == b && q + 1 == f && x + 1 == r) {
                            count[p][q][x] += v;
                        }
                    }
                }
            }
        }
        for (int p = 0; p < Building; p++) {
            for (int q = 0; q < Floor; q++) {
                for (int x = 0; x < Room; x++) {
                    System.out.print(" ");
                    System.out.print(count[p][q][x]);
                }
                System.out.print("\n");
            }
            if (p < Building - 1) {
                System.out.println("####################");
            }
        }
    }
}