import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[][][] count = new int[4][3][10];
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    }
    for (int i = 0; i < count.length; i++) {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    }
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[][][] count = new int[4][3][10];
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    }
    for (int i = 0; i < count.length; i++) {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[][][] count = new int[4][3][10];
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    }
    for (int i = 0; i < count.length; i++) {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int[][][] count = new int[4][3][10];
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    }
    for (int i = 0; i < count.length; i++) {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][][] count = new int[4][3][10]; count new int[4][3][10] 4 3 10 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[b - 1][f - 1][r - 1] += v;
    } {
      int b = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();
      int v = sc.nextInt();
      count[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 count[b - 1][f - 1][r - 1] += v count[b - 1][f - 1][r - 1] count[b - 1][f - 1] count[b - 1] count b - 1 b 1 f - 1 f 1 r - 1 r 1 v for (int i = 0; i < count.length; i++) {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    } int i = 0; int i = 0; i 0 i < count.length i count.length count count.length i++ i++ i {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    } {
      for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      }
      if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      }
    } for (int j = 0; j < count[i].length; j++) {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      } int j = 0; int j = 0; j 0 j < count[i].length j count[i].length count[i] count i count[i].length j++ j++ j {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      } {
        for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        }
        System.out.println();
      } for (int k = 0; k < count[i][j].length; k++) {
          System.out.print(" " + count[i][j][k]);
        } int k = 0; int k = 0; k 0 k < count[i][j].length k count[i][j].length count[i][j] count[i] count i j count[i][j].length k++ k++ k {
          System.out.print(" " + count[i][j][k]);
        } {
          System.out.print(" " + count[i][j][k]);
        } System.out.print(" " + count[i][j][k]) System.out.print System.out System System.out " " + count[i][j][k] " " count[i][j][k] count[i][j] count[i] count i j k System.out.println() System.out.println System.out System System.out if (i < count.length - 1) {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      } i < count.length - 1 i count.length - 1 count.length count count.length 1 {
        for (int j = 0; j < 20; j++) {
          System.out.print('#');
        }
        System.out.println();
      } for (int j = 0; j < 20; j++) {
          System.out.print('#');
        } int j = 0; int j = 0; j 0 j < 20 j 20 j++ j++ j {
          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
import java.util.Scanner;

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