import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  }

} Main public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  } main {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int n = stdin.nextInt(); n stdin.nextInt() stdin.nextInt stdin int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    }; house {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    } { new int[10], new int[10], new int[10] } new int[10] 10 new int[10] 10 new int[10] 10 { new int[10], new int[10], new int[10] } new int[10] 10 new int[10] 10 new int[10] 10 { new int[10], new int[10], new int[10] } new int[10] 10 new int[10] 10 new int[10] 10 { new int[10], new int[10], new int[10] } new int[10] 10 new int[10] 10 new int[10] 10 for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    } {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    } int b = stdin.nextInt(); b stdin.nextInt() stdin.nextInt stdin int f = stdin.nextInt(); f stdin.nextInt() stdin.nextInt stdin int r = stdin.nextInt(); r stdin.nextInt() stdin.nextInt stdin int v = stdin.nextInt(); v stdin.nextInt() stdin.nextInt stdin 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 i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    } int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    } {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    } for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      } int[] arr house[i] house i {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      } {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      } for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        } {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        } System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]) System.out.printf System.out System System.out j < 9 ? " %d" : " %d%n" j < 9 j 9 " %d" " %d%n" arr[j] arr j if (i < 3) {
        System.out.println("####################");
      } i < 3 i 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) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  }

} public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int[][][] house = {
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] },
        { new int[10], new int[10], new int[10] }
    };

    for (int i = 0; i < n; i++) {
      int b = stdin.nextInt();
      int f = stdin.nextInt();
      int r = stdin.nextInt();
      int v = stdin.nextInt();
      house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
      for (int[] arr : house[i]) {
        for (int j = 0; j < 10; j++) {
          System.out.printf(j < 9 ? " %d" : " %d%n", arr[j]);
        }
      }

      if (i < 3) {
        System.out.println("####################");
      }
    }
  }

}