import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        	   //?????±?????\???
        	   String az=input.readLine();
      	       int a=Integer.parseInt(az);
               //[0][0][0]0????????????????§??????????????????????
	           int Array[][][]=new int[5][4][11];
	           int b=0;
	           int f=0;
	           int r=0;
	           int v=0;
	           for(int i=0; i<a; i++){
	        	   String ab = input.readLine();
		           String []strAry = ab.split(" ");
	           //??´??°??\???
	           b=Integer.parseInt(strAry[0]);
	           //????±???\???
	           f=Integer.parseInt(strAry[1]);
	           //??¨?±??????\???
	           r=Integer.parseInt(strAry[2]);
	           //?????°??\???
	              v=Integer.parseInt(strAry[3]);
	             //Array???????????°????????????????¢????
	              if(Array[b][f][r]>0){
	            	  Array[b][f][r]+=v;
	              }else{
	            	  //??????Array???b??´f???r??¨?±??????\?????????????????????????´?
	                    Array[b][f][r]=v;
	              }

	           }
                 int count=1;
	           for(int u=1; u<5; u++){
	        	   for(int o=1; o<4; o++ ){
	        		   for(int q=1; q<11; q++){
	        			   //Array????????°????????\??£?????????????????????????????????????´??????????????????¨??????????????\??£?????????
	        			  System.out.print(" "+Array[u][o][q]);
	        			}
	        		   System.out.println("");
	        		 }
	        	       if(count<4){
                       System.out.print("####################");

	        		   System.out.println("");
	        	       }
	        		   count++;
	        	 }



       		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }



	}//240 Array?????£?????????????????????????????????

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz