/* ITP1_6_C */
import java.io.*;
import java.util.Arrays;

class Main
{
  static final int BUILDING = 4;
  static final int FLOOR = 3;
  static final int ROOM = 10;

  public static void main(String[] args)
  {
    int[][][] count = new int[BUILDING][FLOOR][ROOM];
    // initialization
    for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    }

    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    }
  }
} import java.io.*; io.* java import java.util.Arrays; Arrays java.util class Main
{
  static final int BUILDING = 4;
  static final int FLOOR = 3;
  static final int ROOM = 10;

  public static void main(String[] args)
  {
    int[][][] count = new int[BUILDING][FLOOR][ROOM];
    // initialization
    for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    }

    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    }
  }
} Main static final int BUILDING = 4; BUILDING 4 static final int FLOOR = 3; FLOOR 3 static final int ROOM = 10; ROOM 10 public static void main(String[] args)
  {
    int[][][] count = new int[BUILDING][FLOOR][ROOM];
    // initialization
    for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    }

    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    int[][][] count = new int[BUILDING][FLOOR][ROOM];
    // initialization
    for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    }

    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    }
  } int[][][] count = new int[BUILDING][FLOOR][ROOM]; count new int[BUILDING][FLOOR][ROOM] BUILDING FLOOR ROOM for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    } int i = 0; int i = 0; i 0 i < BUILDING i BUILDING i++ i++ i {
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    } {
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    } for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      } int j = 0; int j = 0; j 0 j < FLOOR j FLOOR j++ j++ j {
          Arrays.fill(count[i][j], 0);
      } {
          Arrays.fill(count[i][j], 0);
      } Arrays.fill(count[i][j], 0) Arrays.fill Arrays count[i][j] count[i] count i j 0 try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    } catch(Exception e){
      System.out.println(e);
    } Exception e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      } {
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      } String[] info = br.readLine().split(" "); info br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int building = Integer.parseInt(info[0]) - 1; building Integer.parseInt(info[0]) - 1 Integer.parseInt(info[0]) Integer.parseInt Integer info[0] info 0 1 int floor = Integer.parseInt(info[1]) - 1; floor Integer.parseInt(info[1]) - 1 Integer.parseInt(info[1]) Integer.parseInt Integer info[1] info 1 1 int room = Integer.parseInt(info[2]) - 1; room Integer.parseInt(info[2]) - 1 Integer.parseInt(info[2]) Integer.parseInt Integer info[2] info 2 1 int persons = Integer.parseInt(info[3]); persons Integer.parseInt(info[3]) Integer.parseInt Integer info[3] info 3 count[building][floor][room] += persons count[building][floor][room] count[building][floor] count[building] count building floor room persons if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return; count[building][floor][room] < 0 || count[building][floor][room] > 9 count[building][floor][room] < 0 count[building][floor][room] count[building][floor] count[building] count building floor room 0 count[building][floor][room] > 9 count[building][floor][room] count[building][floor] count[building] count building floor room 9 return; for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      } {
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      } for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        } {
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        } for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          } int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
            sb.append(" " + count[i][j][k]);
          } {
            sb.append(" " + count[i][j][k]);
          } sb.append(" " + count[i][j][k]) sb.append sb " " + count[i][j][k] " " count[i][j][k] count[i][j] count[i] count i j k sb.append("\n") sb.append sb "\n" if(i == 3);
        else
          sb.append("####################\n"); i == 3 i 3 sb.append("####################\n") sb.append sb "####################\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args
/* ITP1_6_C */
import java.io.*;
import java.util.Arrays;

class Main
{
  static final int BUILDING = 4;
  static final int FLOOR = 3;
  static final int ROOM = 10;

  public static void main(String[] args)
  {
    int[][][] count = new int[BUILDING][FLOOR][ROOM];
    // initialization
    for(int i = 0; i < BUILDING; i++){
      for(int j = 0; j < FLOOR; j++){
          Arrays.fill(count[i][j], 0);
      }
    }

    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());

      // process
      for(int i = 0; i < n; i++){
        String[] info = br.readLine().split(" ");
        int building = Integer.parseInt(info[0]) - 1;
        int floor = Integer.parseInt(info[1]) - 1;
        int room = Integer.parseInt(info[2]) - 1;
        int persons = Integer.parseInt(info[3]);

        count[building][floor][room] += persons;
        if(count[building][floor][room] < 0 || count[building][floor][room] > 9)
          return;
      }

      // output
      for(int i = 0; i < 4; i++){
        for(int j = 0; j < 3; j++){
          for(int k = 0; k < 10; k++){
            sb.append(" " + count[i][j][k]);
          }
          sb.append("\n");
        }
        if(i == 3);
        else
          sb.append("####################\n");
      }
      System.out.print(sb);


    }catch(Exception e){
      System.out.println(e);
    }
  }
}