import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] B = new int[4][3][10]; B new int[4][3][10] 4 3 10 int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        } {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        } int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int f = Integer.parseInt(sc.next()); f Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int r = Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int v = Integer.parseInt(sc.next()); v Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc B[b - 1][f - 1][r - 1] += v B[b - 1][f - 1][r - 1] B[b - 1][f - 1] B[b - 1] B b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            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.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        } {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        } for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            } {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            } for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
                    System.out.printf(" %d", B[i][j][k]);
                } {
                    System.out.printf(" %d", B[i][j][k]);
                } System.out.printf(" %d", B[i][j][k]) System.out.printf System.out System System.out " %d" B[i][j][k] B[i][j] B[i] B i j k System.out.println() System.out.println System.out System System.out if (i != 3) System.out.println("####################"); i != 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][][] B = new int[4][3][10];

        int N = Integer.parseInt(sc.next());
        for (int i = 0; i < N; i++) {
            int b = Integer.parseInt(sc.next());
            int f = Integer.parseInt(sc.next());
            int r = Integer.parseInt(sc.next());
            int v = Integer.parseInt(sc.next());

            B[b - 1][f - 1][r - 1] += v;
        }

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    System.out.printf(" %d", B[i][j][k]);
                }
                System.out.println();
            }
            if (i != 3) System.out.println("####################");
        }
    }
}