#include <iostream>
using namespace std;
int house[4][3][10];
int main(){
  int n; cin>>n;
  for(int i = 0; n > i; i++){
    int a,b,c,d;cin>>a>>b>>c>>d;a--;b--;c--;
    house[a][b][c] += d;
  }
  for(int i = 0; 4 > i; i++){
    for(int j = 0; 3 > j; j++){
      for(int k = 0; 10 > k; k++){
        cout << " " << house[i][j][k];
      }
      cout << endl;
    }
    if(i+1 != 4)cout << "####################" << endl;
  }
}
