import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[][][] hu = new int[4][3][10]; hu new int[4][3][10] 4 3 10 while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        } n != 0 n 0 {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        } int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int v = scan.nextInt(); v scan.nextInt() scan.nextInt scan hu[b - 1][f - 1][r - 1] += v hu[b - 1][f - 1][r - 1] hu[b - 1][f - 1] hu[b - 1] hu b - 1 b 1 f - 1 f 1 r - 1 r 1 v n-- n for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        } int num = 0; int num = 0; num 0 num < 4 num 4 num++ num++ num {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        } {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        } for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            } {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            } for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                } int a = 0; int a = 0; a 0 a < 10 a 10 a++ a++ a {
                    hu[num][i][a] += 0;
                } {
                    hu[num][i][a] += 0;
                } hu[num][i][a] += 0 hu[num][i][a] hu[num][i] hu[num] hu num i a 0 for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        } int num = 0; int num = 0; num 0 num < 4 num 4 num++ num++ num {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        } {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        } for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            } {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            } for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                } int a = 0; int a = 0; a 0 a < 10 a 10 a++ a++ a {
                    System.out.print(" " + hu[num][i][a]);
                } {
                    System.out.print(" " + hu[num][i][a]);
                } System.out.print(" " + hu[num][i][a]) System.out.print System.out System System.out " " + hu[num][i][a] " " hu[num][i][a] hu[num][i] hu[num] hu num i a System.out.println() System.out.println System.out System System.out if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            } num != 4 - 1 num 4 - 1 4 1 {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            } for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                } int i = 0; int i = 0; i 0 i < 20 i 20 i++ i++ i {
                    System.out.print("#");
                } {
                    System.out.print("#");
                } System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][][] hu = new int[4][3][10];

        //b?£?f???r?????????v?????\????????????
        while (n != 0) {
            int b = scan.nextInt();
            int f = scan.nextInt();
            int r = scan.nextInt();
            int v = scan.nextInt();
            hu[b - 1][f - 1][r - 1] += v;
            n--;
        }

        //????????¨??????0?????\??????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    hu[num][i][a] += 0;
                }
            }
        }

        //??¨?????????
        for (int num = 0; num < 4; num++) {
            for (int i = 0; i < 3; i++) {
                for (int a = 0; a < 10; a++) {
                    System.out.print(" " + hu[num][i][a]);
                }
                System.out.println();
            }

            if (num != 4 - 1) {
                for (int i = 0; i < 20; i++) {
                    System.out.print("#");
                }
                System.out.println();
            }
        }
    }
}