import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    } main {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int[][][] log = new int[4][3][10]; log new int[4][3][10] 4 3 10 for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[b][f][r] += v;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[b][f][r] += v;
        } {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[b][f][r] += v;
        } line = sc.nextLine() line sc.nextLine() sc.nextLine sc String[] l = line.split(" "); l line.split(" ") line.split line " " int b = Integer.parseInt(l[0]) - 1; b Integer.parseInt(l[0]) - 1 Integer.parseInt(l[0]) Integer.parseInt Integer l[0] l 0 1 int f = Integer.parseInt(l[1]) - 1; f Integer.parseInt(l[1]) - 1 Integer.parseInt(l[1]) Integer.parseInt Integer l[1] l 1 1 int r = Integer.parseInt(l[2]) - 1; r Integer.parseInt(l[2]) - 1 Integer.parseInt(l[2]) Integer.parseInt Integer l[2] l 2 1 int v = Integer.parseInt(l[3]); v Integer.parseInt(l[3]) Integer.parseInt Integer l[3] l 3 log[b][f][r] += v log[b][f][r] log[b][f] log[b] log 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(" " + log[b][f][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(" " + log[b][f][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(" " + log[b][f][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(" " + log[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(" " + log[b][f][r]);
            }
            System.out.println();
          } {
            for(int r = 0; r < 10; r++) {
              System.out.print(" " + log[b][f][r]);
            }
            System.out.println();
          } for(int r = 0; r < 10; r++) {
              System.out.print(" " + log[b][f][r]);
            } int r = 0; int r = 0; r 0 r < 10 r 10 r++ r++ r {
              System.out.print(" " + log[b][f][r]);
            } {
              System.out.print(" " + log[b][f][r]);
            } System.out.print(" " + log[b][f][r]) System.out.print System.out System System.out " " + log[b][f][r] " " log[b][f][r] log[b][f] log[b] log 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 "####################" String[] args args public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);

        int[][][] log = new int[4][3][10];
        for(int i = 0; i < n; i++) {
          line = sc.nextLine();
          String[] l = line.split(" ");

          int b = Integer.parseInt(l[0]) - 1;
          int f = Integer.parseInt(l[1]) - 1;
          int r = Integer.parseInt(l[2]) - 1;
          int v = Integer.parseInt(l[3]);

          log[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(" " + log[b][f][r]);
            }
            System.out.println();
          }
          if(b != 3) {
            System.out.println("####################");
          }
        }
    }
}