#include <stdio.h>

#define NUM_BUILDING 4
#define NUM_FLOOR 3
#define NUM_ROOM 10

int main()
{
  int n, b, f, r, v;
  int tenant[NUM_BUILDING][NUM_FLOOR][NUM_ROOM] = {};

  scanf("%d", &n);
  while (n--) {
    scanf("%d %d %d %d", &b, &f, &r, &v);
    tenant[b-1][f-1][r-1] += v;
  }
  for (b = 0; b < NUM_BUILDING; b++) {
    for (f = 0; f < NUM_FLOOR; f++) {
      for (r = 0; r < NUM_ROOM; r++) {
        printf(" %d", tenant[b][f][r]);
      }
      putchar('\n');
    }
    if (b < NUM_BUILDING - 1) printf("####################\n");
  }

  return 0;
}

