import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());

    int[][] building_1 = new int[3][10];
    int[][] building_2 = new int[3][10];
    int[][] building_3 = new int[3][10];
    int[][] building_4 = new int[3][10];

    int count = 0;
    while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    }

    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    }
  }
} import java.io.*; io.* java class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());

    int[][] building_1 = new int[3][10];
    int[][] building_2 = new int[3][10];
    int[][] building_3 = new int[3][10];
    int[][] building_4 = new int[3][10];

    int count = 0;
    while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    }

    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    }
  }
} Main public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());

    int[][] building_1 = new int[3][10];
    int[][] building_2 = new int[3][10];
    int[][] building_3 = new int[3][10];
    int[][] building_4 = new int[3][10];

    int count = 0;
    while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    }

    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    }
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());

    int[][] building_1 = new int[3][10];
    int[][] building_2 = new int[3][10];
    int[][] building_3 = new int[3][10];
    int[][] building_4 = new int[3][10];

    int count = 0;
    while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    }

    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    }
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][] building_1 = new int[3][10]; building_1 new int[3][10] 3 10 int[][] building_2 = new int[3][10]; building_2 new int[3][10] 3 10 int[][] building_3 = new int[3][10]; building_3 new int[3][10] 3 10 int[][] building_4 = new int[3][10]; building_4 new int[3][10] 3 10 int count = 0; count 0 while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    } count < n count n {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    } String str1 = br.readLine(); str1 br.readLine() br.readLine br String[] str2 = str1.split(" "); str2 str1.split(" ") str1.split str1 " " int b = Integer.parseInt(str2[0]); b Integer.parseInt(str2[0]) Integer.parseInt Integer str2[0] str2 0 int f = Integer.parseInt(str2[1]); f Integer.parseInt(str2[1]) Integer.parseInt Integer str2[1] str2 1 int r = Integer.parseInt(str2[2]); r Integer.parseInt(str2[2]) Integer.parseInt Integer str2[2] str2 2 int v = Integer.parseInt(str2[3]); v Integer.parseInt(str2[3]) Integer.parseInt Integer str2[3] str2 3 if (b == 1){
      building_1[f - 1][r - 1] += v;
    } b == 1 b 1 {
      building_1[f - 1][r - 1] += v;
    } building_1[f - 1][r - 1] += v building_1[f - 1][r - 1] building_1[f - 1] building_1 f - 1 f 1 r - 1 r 1 v if (b == 2){
      building_2[f - 1][r - 1] += v;
    } b == 2 b 2 {
      building_2[f - 1][r - 1] += v;
    } building_2[f - 1][r - 1] += v building_2[f - 1][r - 1] building_2[f - 1] building_2 f - 1 f 1 r - 1 r 1 v if (b == 3){
      building_3[f - 1][r - 1] += v;
    } b == 3 b 3 {
      building_3[f - 1][r - 1] += v;
    } building_3[f - 1][r - 1] += v building_3[f - 1][r - 1] building_3[f - 1] building_3 f - 1 f 1 r - 1 r 1 v if (b == 4){
      building_4[f - 1][r - 1] += v;
    } b == 4 b 4 {
      building_4[f - 1][r - 1] += v;
    } building_4[f - 1][r - 1] += v building_4[f - 1][r - 1] building_4[f - 1] building_4 f - 1 f 1 r - 1 r 1 v count++ count for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    } {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    } for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
        System.out.print(" " + building_1[i][j]);
      } {
        System.out.print(" " + building_1[i][j]);
      } System.out.print(" " + building_1[i][j]) System.out.print System.out System System.out " " + building_1[i][j] " " building_1[i][j] building_1[i] building_1 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    } {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    } for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
        System.out.print(" " + building_2[i][j]);
      } {
        System.out.print(" " + building_2[i][j]);
      } System.out.print(" " + building_2[i][j]) System.out.print System.out System System.out " " + building_2[i][j] " " building_2[i][j] building_2[i] building_2 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    } {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    } for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
        System.out.print(" " + building_3[i][j]);
      } {
        System.out.print(" " + building_3[i][j]);
      } System.out.print(" " + building_3[i][j]) System.out.print System.out System System.out " " + building_3[i][j] " " building_3[i][j] building_3[i] building_3 i j System.out.println() System.out.println System.out System System.out System.out.println("####################") System.out.println System.out System System.out "####################" for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    } {
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    } for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
        System.out.print(" " + building_4[i][j]);
      } {
        System.out.print(" " + building_4[i][j]);
      } System.out.print(" " + building_4[i][j]) System.out.print System.out System System.out " " + building_4[i][j] " " building_4[i][j] building_4[i] building_4 i j System.out.println() System.out.println System.out System System.out String[] args args
import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());

    int[][] building_1 = new int[3][10];
    int[][] building_2 = new int[3][10];
    int[][] building_3 = new int[3][10];
    int[][] building_4 = new int[3][10];

    int count = 0;
    while(count < n){
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int b = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int v = Integer.parseInt(str2[3]);

    if (b == 1){
      building_1[f - 1][r - 1] += v;
    }
    if (b == 2){
      building_2[f - 1][r - 1] += v;
    }
    if (b == 3){
      building_3[f - 1][r - 1] += v;
    }
    if (b == 4){
      building_4[f - 1][r - 1] += v;
    }
    count++;
    }

    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_1[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_2[i][j]);
      }
        System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_3[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");
    for(int i = 0; i < 3; i++){
      for (int j = 0; j < 10; j++){
        System.out.print(" " + building_4[i][j]);
      }
      System.out.println();
    }
  }
}