import java.util.*;

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

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    } main {
        Scanner sc = new Scanner(System.in);

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] officialHouses = new int[4][3][10]; officialHouses new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

            officialHouses[b-1][f-1][r-1] += v;
        } n-- > 0 n-- n 0 {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

            officialHouses[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 officialHouses[b-1][f-1][r-1] += v officialHouses[b-1][f-1][r-1] officialHouses[b-1][f-1] officialHouses[b-1] officialHouses b-1 b 1 f-1 f 1 r-1 r 1 v for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        } {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        } for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            } {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            } for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                } {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                } System.out.print(' ') System.out.print System.out System System.out ' ' System.out.print(officialHouses[b][f][r]) System.out.print System.out System System.out officialHouses[b][f][r] officialHouses[b][f] officialHouses[b] officialHouses b f r System.out.println() System.out.println System.out System System.out if (b < 4-1)
                System.out.println("####################"); b < 4-1 b 4-1 4 1 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[][][] officialHouses = new int[4][3][10];

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    }
} Main
import java.util.*;

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

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

        int n = sc.nextInt();
 
        while (n-- > 0) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();

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

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(' ');
                    System.out.print(officialHouses[b][f][r]);
                }
                System.out.println();
            }
            if (b < 4-1)
                System.out.println("####################");
        }
    }
}

