#include<bits/stdc++.h>
using namespace std;

int main(void){
	int n,card[4][3][10]={},b,f,r,v;
  
  cin>>n;
  for (int i=0;i<n;i++){
  	cin>>b>>f>>r>>v;
    b--;
    f--;
    r--;
    card[b][f][r]+=v;
  }
  
  for (int i=0;i<4;i++){
    if (i!=0) cout<<"####################"<<endl;
   for (int j=0;j<3;j++){
     for (int k=0;k<10;k++){
       cout<<' '; 
       cout<<card[i][j][k];
     }
     cout<<endl;
   }
    
  }
	return 0;
}
