import java.util.*;

public class Main {
    public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    }
} Main public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    } main {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    } ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>(); rooms new ArrayList<ArrayList<ArrayList<Integer>>>() for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        } int b = 0; int b = 0; b 0 b < 4 b 4 b++ b++ b {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        } {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        } rooms.add(b, new ArrayList<ArrayList<Integer>>()) rooms.add rooms b new ArrayList<ArrayList<Integer>>() for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            } int f = 0; int f = 0; f 0 f < 3 f 3 f++ f++ f {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            } {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            } rooms.get(b).add(f, new ArrayList<Integer>()) rooms.get(b).add rooms.get(b) rooms.get rooms b f new ArrayList<Integer>() for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    rooms.get(b).get(f).add(0);
                } {
                    rooms.get(b).get(f).add(0);
                } rooms.get(b).get(f).add(0) rooms.get(b).get(f).add rooms.get(b).get(f) rooms.get(b).get rooms.get(b) rooms.get rooms b f 0 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + v);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + v);
        } {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + v);
        } int b = scanner.nextInt() - 1; b scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int f = scanner.nextInt() - 1; f scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int r = scanner.nextInt() - 1; r scanner.nextInt() - 1 scanner.nextInt() scanner.nextInt scanner 1 int v = scanner.nextInt(); v scanner.nextInt() scanner.nextInt scanner rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + v) rooms.get(b).get(f).set rooms.get(b).get(f) rooms.get(b).get rooms.get(b) rooms.get rooms b f r rooms.get(b).get(f).get(r) + v rooms.get(b).get(f).get(r) rooms.get(b).get(f).get rooms.get(b).get(f) rooms.get(b).get rooms.get(b) rooms.get rooms b f r 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        } {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        } for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            } {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            } for (int r = 0; r < 10; r++) {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(r));
                } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(r));
                } {
                    System.out.print(" ");
                    System.out.print(rooms.get(b).get(f).get(r));
                } System.out.print(" ") System.out.print System.out System System.out " " System.out.print(rooms.get(b).get(f).get(r)) System.out.print System.out System System.out rooms.get(b).get(f).get(r) rooms.get(b).get(f).get rooms.get(b).get(f) rooms.get(b).get rooms.get(b) rooms.get rooms b f r System.out.println("") System.out.println System.out System System.out "" if (b != 3) {
                System.out.println("####################");
            } b != 3 b 3 {
                System.out.println("####################");
            } System.out.println("####################") System.out.println System.out System System.out "####################" scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    }
} public class Main {
    public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        ArrayList<ArrayList<ArrayList<Integer>>> rooms =
            new ArrayList<ArrayList<ArrayList<Integer>>>();
        for (int b = 0; b < 4; b++) {
            rooms.add(b, new ArrayList<ArrayList<Integer>>());
            for (int f = 0; f < 3; f++) {
                rooms.get(b).add(f, new ArrayList<Integer>());
                for (int r = 0; r < 10; r++) {
                    rooms.get(b).get(f).add(0);
                }
            }
        }
 
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
 
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt() - 1;
            int f = scanner.nextInt() - 1;
            int r = scanner.nextInt() - 1;
            int v = scanner.nextInt();
            rooms.get(b).get(f).set(r, rooms.get(b).get(f).get(r) + 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(rooms.get(b).get(f).get(r));
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }
        scanner.close();
    }
}

