import java.util.Scanner;

class Main{
  public static void main(String args[]){
    int i,j,k,n,b,f,r,v;
    int [][] one = new int[3][10];
    int [][] two = new int[3][10];
    int [][] three = new int[3][10];
    int [][] four = new int[3][10];
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    }
    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    }
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    }

    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String args[]){
    int i,j,k,n,b,f,r,v;
    int [][] one = new int[3][10];
    int [][] two = new int[3][10];
    int [][] three = new int[3][10];
    int [][] four = new int[3][10];
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    }
    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    }
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    }

    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    }
  }
} Main public static void main(String args[]){
    int i,j,k,n,b,f,r,v;
    int [][] one = new int[3][10];
    int [][] two = new int[3][10];
    int [][] three = new int[3][10];
    int [][] four = new int[3][10];
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    }
    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    }
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    }

    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    }
  } main {
    int i,j,k,n,b,f,r,v;
    int [][] one = new int[3][10];
    int [][] two = new int[3][10];
    int [][] three = new int[3][10];
    int [][] four = new int[3][10];
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    }
    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    }
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    }

    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    }
  } int i i j j k k n n b b f f r r v; v int [][] one = new int[3][10]; one new int[3][10] 3 10 int [][] two = new int[3][10]; two new int[3][10] 3 10 int [][] three = new int[3][10]; three new int[3][10] 3 10 int [][] four = new int[3][10]; four new int[3][10] 3 10 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    } i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    } {
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    } for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      } j = 0; j = 0 j 0 j < 10 j 10 j++ j++ j {
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      } {
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      } one[i][j] = 0 one[i][j] one[i] one i j 0 two[i][j] = 0 two[i][j] two[i] two i j 0 three[i][j] = 0 three[i][j] three[i] three i j 0 four[i][j]  = 0 four[i][j] four[i] four i j 0 for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[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();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    } {
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[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 if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      } b == 1 b 1 {
        one[f - 1][r - 1] += v;
      } one[f - 1][r - 1] += v one[f - 1][r - 1] one[f - 1] one f - 1 f 1 r - 1 r 1 v if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      } b == 2 b 2 {
        two[f - 1][r - 1] += v;
      } two[f - 1][r - 1] += v two[f - 1][r - 1] two[f - 1] two f - 1 f 1 r - 1 r 1 v if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      } b == 3 b 3 {
        three[f - 1][r - 1] += v;
      } three[f - 1][r - 1] += v three[f - 1][r - 1] three[f - 1] three f - 1 f 1 r - 1 r 1 v if(b == 4){
        four[f - 1][r - 1] += v;
      } b == 4 b 4 {
        four[f - 1][r - 1] += v;
      } four[f - 1][r - 1] += v four[f - 1][r - 1] four[f - 1] four f - 1 f 1 r - 1 r 1 v for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    } i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    } {
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    } for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      } j = 0; j = 0 j 0 j < 10 j 10 j++ j++ j {
          System.out.print(" " + one[i][j]);
      } {
          System.out.print(" " + one[i][j]);
      } System.out.print(" " + one[i][j]) System.out.print System.out System System.out " " + one[i][j] " " one[i][j] one[i] one 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(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    } i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    } {
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    } for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      } j = 0; j = 0 j 0 j < 10 j 10 j++ j++ j {

          System.out.print(" " + two[i][j]);
      } {

          System.out.print(" " + two[i][j]);
      } System.out.print(" " + two[i][j]) System.out.print System.out System System.out " " + two[i][j] " " two[i][j] two[i] two 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(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    } i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    } {
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    } for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      } j = 0; j = 0 j 0 j < 10 j 10 j++ j++ j {
          System.out.print(" " + three[i][j]);
      } {
          System.out.print(" " + three[i][j]);
      } System.out.print(" " + three[i][j]) System.out.print System.out System System.out " " + three[i][j] " " three[i][j] three[i] three 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(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    } i = 0; i = 0 i 0 i < 3 i 3 i++ i++ i {
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    } {
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    } for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      } j = 0; j = 0 j 0 j < 10 j 10 j++ j++ j {
          System.out.print(" " + four[i][j]);
      } {
          System.out.print(" " + four[i][j]);
      } System.out.print(" " + four[i][j]) System.out.print System.out System System.out " " + four[i][j] " " four[i][j] four[i] four i j 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[]){
    int i,j,k,n,b,f,r,v;
    int [][] one = new int[3][10];
    int [][] two = new int[3][10];
    int [][] three = new int[3][10];
    int [][] four = new int[3][10];
    Scanner sc = new Scanner(System.in);
    n = sc.nextInt();
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
        one[i][j] = 0;
        two[i][j] = 0;
        three[i][j] = 0;
        four[i][j]  = 0;
      }
    }
    for(i = 0;i < n;i++){
      b = sc.nextInt();
      f = sc.nextInt();
      r = sc.nextInt();
      v = sc.nextInt();
      if(b == 1){
        one[f - 1][r - 1] += v;
      }
      else if(b == 2){
        two[f - 1][r - 1] += v;
      }
      else if(b == 3){
        three[f - 1][r - 1] += v;
      }
      else if(b == 4){
        four[f - 1][r - 1] += v;
      }
    }
    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + one[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){

          System.out.print(" " + two[i][j]);
      }
      System.out.println();
    }

    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + three[i][j]);
      }
      System.out.println();
    }
    System.out.println("####################");

    for(i = 0;i < 3;i++){
      for(j = 0;j < 10;j++){
          System.out.print(" " + four[i][j]);
      }
      System.out.println();
    }
  }
}