import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();

        int house[][][];
        house = new int[4][3][10];
        for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        }

        for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        }
      for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        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 n  = sc.nextInt();

        int house[][][];
        house = new int[4][3][10];
        for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        }

        for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        }
      for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();

        int house[][][];
        house = new int[4][3][10];
        for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        }

        for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        }
      for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      }
    } main {
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();

        int house[][][];
        house = new int[4][3][10];
        for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        }

        for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        }
      for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n  = sc.nextInt(); n sc.nextInt() sc.nextInt sc int house[][][]; house house = new int[4][3][10] house new int[4][3][10] 4 3 10 for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        } int h=0; int h=0; h 0 h<4 h 4 h++ h++ h {
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        } {
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        } for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          } {
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          } for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            } int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
              house[h][i][j] = 0;
            } {
              house[h][i][j] = 0;
            } house[h][i][j] = 0 house[h][i][j] house[h][i] house[h] house h i j 0 for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        } int m=1; int m=1; m 1 m<=n m n m++ m++ m {
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        } {
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[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 house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 1 house[b-1][f-1][r-1] + v house[b-1][f-1][r-1] house[b-1][f-1] house[b-1] house b-1 b 1 f-1 f 1 r-1 r 1 v for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      } int h2=0; int h2=0; h2 0 h2<4 h2 4 h2++ h2++ h2 {
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      } {
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      } for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        } int i2=0; int i2=0; i2 0 i2<3 i2 3 i2++ i2++ i2 {
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        } {
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        } for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          } int j2=0; int j2=0; j2 0 j2<10 j2 10 j2++ j2++ j2 {
            System.out.print(" " + house[h2][i2][j2]);
          } {
            System.out.print(" " + house[h2][i2][j2]);
          } System.out.print(" " + house[h2][i2][j2]) System.out.print System.out System System.out " " + house[h2][i2][j2] " " house[h2][i2][j2] house[h2][i2] house[h2] house h2 i2 j2 System.out.println("") System.out.println System.out System System.out "" if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        } h2 != 3 h2 3 {
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        } for(int x=1;x<=20;x++){
          System.out.print("#");
          } int x=1; int x=1; x 1 x<=20 x 20 x++ x++ x {
          System.out.print("#");
          } {
          System.out.print("#");
          } System.out.print("#") System.out.print System.out System System.out "#" if(h2 != 3){
        System.out.println("");
      } h2 != 3 h2 3 {
        System.out.println("");
      } 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 n  = sc.nextInt();

        int house[][][];
        house = new int[4][3][10];
        for(int h=0;h<4;h++){
          for(int i=0;i<3;i++){
            for(int j=0;j<10;j++){
              house[h][i][j] = 0;
            }
          }
        }

        for(int m=1;m<=n;m++){
          int b = sc.nextInt();
          int f = sc.nextInt();
          int r = sc.nextInt();
          int v = sc.nextInt();
          house[b-1][f-1][r-1] = house[b-1][f-1][r-1] + v;
        }
      for(int h2=0;h2<4;h2++){
        for(int i2=0;i2<3;i2++){
          for(int j2=0;j2<10;j2++){
            System.out.print(" " + house[h2][i2][j2]);
          }
          System.out.println("");
        }
        if(h2 != 3){
          for(int x=1;x<=20;x++){
          System.out.print("#");
          }
        }
        if(h2 != 3){
        System.out.println("");
      }
      }
    }
}
