import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 *

?????§?????????????????¢????????¨?±?????????????????????¬???????£??????????????????????????????¬????????\?±??????????????????±???????????????????????¨?±??????\?±??????°???????????????????????°?????????????????????????????????

n??¶????????±????????????????????????????????±??§?????????????????´??°b, f, r, v????????????????????????????????????b?£?f??????r???????????¨?±????v??????????????§??\?±????????????¨??????????????????v?????????????????´??????v????????????????????¨??????????????????

???????????¨????????¨?±?????????°?????\?±????????????????????????¨????????????

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_C

 *
 *
 * @author wsKmatsuda
 *
 */
public class Main {

	public static void main(String[] args) {

		new Main().run();

	}


	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<InputData> inputDataList = new ArrayList<InputData>();

        try {
        	int cardNum = Integer.parseInt(reader.readLine());
        	int cnt = 0;
        	//??\???
	        while(true){
				inputData = reader.readLine();
				String[] strData = inputData.split(" ");
				inputDataList.add(new InputData(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2]),Integer.parseInt(strData[3])));
				cnt++;
	            if(cnt == cardNum){
	            	break;
	            }
	        }

	        //??\??????????¨????
	        Collage collage = new Collage();
	        for(InputData data :inputDataList){
	        	collage.setData(data);
	        }

	        //????????????
	        collage.output();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * InputData?????????
	 * ?£????????????¨?±????????????\?±??????°?????????
	 */
	class InputData{

		//?£?
		public int b;
		//???
		public int f;
		//??¨?±???????
		public int r;
		//??\?±??????°???????????´?????????????????°???
		public int v;

		InputData(int _b ,int _f,int _r,int _v){
			b = _b;
			f = _f;
			r = _r;
			v = _v;
		}
	}

	class Collage{

		int[][][] room = {
				{
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0}
				},
				{
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0}
				},
				{
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0}
				},
				{
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0},
					{0,0,0,0,0,0,0,0,0,0}
				},
		};

		/**
		 * ?????????????????????
		 */
		Collage(){

		}

		/**
		 * ??\????????????????¨??????????
		 * @param inputData
		 */
		public void setData(InputData inputData){

			room[inputData.b-1][inputData.f-1][inputData.r-1] += inputData.v;

		}

		/**
		 * ??????
		 */
		public void output(){

			for(int bc = 0;bc < room.length ; bc++){
				for(int fc=0;fc < room[0].length ; fc++){
					for(int rc=0;rc < room[0][0].length ; rc++){
						System.out.print(" " + room[bc][fc][rc]);
					}
					System.out.println();
				}
				if(bc != room.length-1){
					System.out.println("####################");
				}
			}

		}


	}

}

Measured memory_bytes: 24636