import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][][] room = new int[4][3][10]; room new int[4][3][10] 4 3 10 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    } 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++) {
          room[b][f][r] = 0;
        }
      }
    } {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    } for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      } int f=0; int f=0; f 0 f<3 f 3 f++ f++ f {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      } {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      } for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        } int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
          room[b][f][r] = 0;
        } {
          room[b][f][r] = 0;
        } room[b][f][r] = 0 room[b][f][r] room[b][f] room[b] room b f r 0 for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += v;
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += v;
    } {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += v;
    } String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(input[0]); b Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 int f = Integer.parseInt(input[1]); f Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 int r = Integer.parseInt(input[2]); r Integer.parseInt(input[2]) Integer.parseInt Integer input[2] input 2 int v = Integer.parseInt(input[3]); v Integer.parseInt(input[3]) Integer.parseInt Integer input[3] input 3 room[b-1][f-1][r-1] += v room[b-1][f-1][r-1] room[b-1][f-1] room[b-1] room b-1 b 1 f-1 f 1 r-1 r 1 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(" " + room[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(" " + room[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(" " + room[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(" " + room[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(" " + room[b][f][r]);
        }
        System.out.println();
      } {
        for(int r=0;r<10;r++) {
          System.out.print(" " + room[b][f][r]);
        }
        System.out.println();
      } for(int r=0;r<10;r++) {
          System.out.print(" " + room[b][f][r]);
        } int r=0; int r=0; r 0 r<10 r 10 r++ r++ r {
          System.out.print(" " + room[b][f][r]);
        } {
          System.out.print(" " + room[b][f][r]);
        } System.out.print(" " + room[b][f][r]) System.out.print System.out System System.out " " + room[b][f][r] " " room[b][f][r] room[b][f] room[b] room 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) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  }
} public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int[][][] room = new int[4][3][10];
    int n = Integer.parseInt(br.readLine());
    for(int b=0;b<4;b++) {
      for(int f=0;f<3;f++) {
        for(int r=0;r<10;r++) {
          room[b][f][r] = 0;
        }
      }
    }
    for(int i=0;i<n;i++) {
      String[] input = br.readLine().split(" ");
      int b = Integer.parseInt(input[0]);
      int f = Integer.parseInt(input[1]);
      int r = Integer.parseInt(input[2]);
      int v = Integer.parseInt(input[3]);
      room[b-1][f-1][r-1] += 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(" " + room[b][f][r]);
        }
        System.out.println();
      }
      if(b!=3) {
        System.out.println("####################");
      }
    }
  }
}