public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  } run {
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  } java.util.Scanner sc = new java.util.Scanner(in); sc new java.util.Scanner(in) int n n b b f f r r v; v int[][][] a; a int i i j j k; k n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = new int[4][3][10] a new int[4][3][10] 4 3 10 for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    } i = 0; i = 0 i 0 i < n i n i++ i++ i {
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    } {
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    } b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc a[b - 1][f - 1][r - 1] += v a[b - 1][f - 1][r - 1] a[b - 1][f - 1] a[b - 1] a b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    } i = 0; i = 0 i 0 i < 4 i 4 i++ i++ i {
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    } {
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    } for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      } j = 0; j = 0 j 0 j < 3 j 3 j++ j++ j {
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      } {
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      } for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        } k = 0; k = 0 k 0 k < 10 k 10 k++ k++ k {
          System.out.print(" " + a[i][j][k]);
        } {
          System.out.print(" " + a[i][j][k]);
        } System.out.print(" " + a[i][j][k]) System.out.print System.out System System.out " " + a[i][j][k] " " a[i][j][k] a[i][j] a[i] a i j k System.out.println() System.out.println System.out System System.out if(i == 3)break; i == 3 i 3 break; System.out.println("####################") System.out.println System.out System System.out "####################" sc.close() sc.close sc java.io.InputStream in in java.io.PrintStream out out public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  } main {
    (new Main()).run(System.in, System.out);
  } (new Main()).run(System.in, System.out) (new Main()).run (new Main()) System.in System System.in System.out System System.out String[] args args public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n, b, f, r, v;
    int[][][] a;
    int i, j, k;

    n = sc.nextInt();
    a = new int[4][3][10];

    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      a[b - 1][f - 1][r - 1] += v;
    }

    for(i = 0;i < 4;i++){
      for(j = 0;j < 3;j++){
        for(k = 0;k < 10;k++){
          System.out.print(" " + a[i][j][k]);
        }
        System.out.println();
      }
      if(i == 3)break;
      System.out.println("####################");
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}