import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    }

    private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            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 n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    }

    private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[][][] dorm = new int[4][3][10]; dorm new int[4][3][10] 4 3 10 for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        } {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int v = sc.nextInt(); v sc.nextInt() sc.nextInt sc dorm[b-1][f-1][r-1] += v dorm[b-1][f-1][r-1] dorm[b-1][f-1] dorm[b-1] dorm b-1 b 1 f-1 f 1 r-1 r 1 v for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        } int i=0; int i=0; i 0 i<3 i 3 ++i ++i i {
            print_dorm(dorm, i);
            System.out.println("####################");
        } {
            print_dorm(dorm, i);
            System.out.println("####################");
        } print_dorm(dorm, i) print_dorm dorm i System.out.println("####################") System.out.println System.out System System.out "####################" print_dorm(dorm, 3) print_dorm dorm 3 sc.close() sc.close sc String[] args args private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    } print_dorm {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    } for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][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(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        } {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        } for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            } int j=0; int j=0; j 0 j<10 j 10 ++j ++j j {
                System.out.print(" " + dorm[wing][i][j]);
            } {
                System.out.print(" " + dorm[wing][i][j]);
            } System.out.print(" " + dorm[wing][i][j]) System.out.print System.out System System.out " " + dorm[wing][i][j] " " dorm[wing][i][j] dorm[wing][i] dorm[wing] dorm wing i j System.out.println("") System.out.println System.out System System.out "" int[][][] dorm dorm int wing wing public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    }

    private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    }

    private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][][] dorm = new int[4][3][10];
        for (int i=0; i<n; ++i) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            dorm[b-1][f-1][r-1] += v;
        }
        for (int i=0; i<3; ++i) {
            print_dorm(dorm, i);
            System.out.println("####################");
        }
        print_dorm(dorm, 3);
        sc.close();
    }

    private static void print_dorm(int[][][] dorm, int wing) {
        for (int i=0; i<3; ++i) {
            for (int j=0; j<10; ++j) {
                System.out.print(" " + dorm[wing][i][j]);
            }
            System.out.println("");
        }
    }
}
