import java.util.*;
import java.io.*;

class Main {

  static int[][][] residence = new int[4][3][10];
  static int m = 0;

  public static void main(String[] args) {
    int[] v = new int[4];
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    init();
    sc.nextLine();
    for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    }
    output();
  }

  static void init() {
    for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } }
  }

  static void output() {
    for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    }
  }

} import java.util.*; util.* java import java.io.*; io.* java class Main {

  static int[][][] residence = new int[4][3][10];
  static int m = 0;

  public static void main(String[] args) {
    int[] v = new int[4];
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    init();
    sc.nextLine();
    for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    }
    output();
  }

  static void init() {
    for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } }
  }

  static void output() {
    for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    }
  }

} Main static int[][][] residence = new int[4][3][10]; residence new int[4][3][10] 4 3 10 static int m = 0; m 0 public static void main(String[] args) {
    int[] v = new int[4];
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    init();
    sc.nextLine();
    for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    }
    output();
  } main {
    int[] v = new int[4];
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    init();
    sc.nextLine();
    for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    }
    output();
  } int[] v = new int[4]; v new int[4] 4 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc init() init sc.nextLine() sc.nextLine sc for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    } {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    } String[] s = sc.nextLine().split(" "); s sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      } int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
        v[j] = Integer.parseInt(s[j]);
      } {
        v[j] = Integer.parseInt(s[j]);
      } v[j] = Integer.parseInt(s[j]) v[j] v j Integer.parseInt(s[j]) Integer.parseInt Integer s[j] s j residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3] residence[v[0] - 1][v[1] - 1][v[2] - 1] residence[v[0] - 1][v[1] - 1] residence[v[0] - 1] residence v[0] - 1 v[0] v 0 1 v[1] - 1 v[1] v 1 1 v[2] - 1 v[2] v 2 1 residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3] residence[v[0] - 1][v[1] - 1][v[2] - 1] residence[v[0] - 1][v[1] - 1] residence[v[0] - 1] residence v[0] - 1 v[0] v 0 1 v[1] - 1 v[1] v 1 1 v[2] - 1 v[2] v 2 1 v[3] v 3 output() output String[] args args static void init() {
    for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } }
  } init {
    for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } }
  } for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } } int[][] building residence { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } } { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } } for (int[] floor : building) {
       for (int room : floor) { room = 0; } } int[] floor building {
       for (int room : floor) { room = 0; } } {
       for (int room : floor) { room = 0; } } for (int room : floor) { room = 0; } int room floor { room = 0; } { room = 0; } room = 0 room 0 static void output() {
    for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    }
  } output {
    for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    }
  } for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    } int[][] building residence {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    } {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    } m++ m for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); } int[] floor building { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); } { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); } for (int room : floor) { System.out.print(" " + room); } int room floor { System.out.print(" " + room); } { System.out.print(" " + room); } System.out.print(" " + room) System.out.print System.out System System.out " " + room " " room System.out.println() System.out.println System.out System System.out if (m != 4) System.out.println("####################"); m != 4 m 4 System.out.println("####################") System.out.println System.out System System.out "####################"
import java.util.*;
import java.io.*;

class Main {

  static int[][][] residence = new int[4][3][10];
  static int m = 0;

  public static void main(String[] args) {
    int[] v = new int[4];
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    init();
    sc.nextLine();
    for (int i = 0; i < n; i++) {
      // line???????????§split???????????¨?±??????¨????????°?????±?????´??°????????????
      String[] s = sc.nextLine().split(" ");
      for (int j = 0; j < 4; j++) {
        v[j] = Integer.parseInt(s[j]);
      }
      residence[v[0] - 1][v[1] - 1][v[2] - 1] = residence[v[0] - 1][v[1] - 1][v[2] - 1] + v[3];
    }
    output();
  }

  static void init() {
    for (int[][] building : residence) { for (int[] floor : building) {
       for (int room : floor) { room = 0; } } }
  }

  static void output() {
    for (int[][] building : residence) {
      m++;
      for (int[] floor : building) { for (int room : floor) { System.out.print(" " + room); }
        System.out.println(); }
      if (m != 4) System.out.println("####################");
    }
  }

}