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

public class Main {

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][][] tenantInfo = new int[4][3][10]; tenantInfo new int[4][3][10] 4 3 10 try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		} try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			} catch(IOException ioe){
			} IOException ioe {
			} {
				if(br != null){
					br.close();
				}
			} if(br != null){
					br.close();
				} br != null br null {
					br.close();
				} br.close() br.close br {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String str; str String[] strArr; strArr int b b f f r r v; v for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			} int i=0; int i=0; i 0 i<num i num i++ i++ i {
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			} {
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			} str = br.readLine() str br.readLine() br.readLine br strArr = str.split(" ") strArr str.split(" ") str.split str " " b = Integer.parseInt(strArr[0])-1 b Integer.parseInt(strArr[0])-1 Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 1 f = Integer.parseInt(strArr[1])-1 f Integer.parseInt(strArr[1])-1 Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 1 r = Integer.parseInt(strArr[2])-1 r Integer.parseInt(strArr[2])-1 Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 1 v = Integer.parseInt(strArr[3]) v Integer.parseInt(strArr[3]) Integer.parseInt Integer strArr[3] strArr 3 tenantInfo[b][f][r]+=v tenantInfo[b][f][r] tenantInfo[b][f] tenantInfo[b] tenantInfo b f r v StringBuilder output = new StringBuilder(); output new StringBuilder() for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			} int i = 0; int i = 0; i 0 i<tenantInfo.length i tenantInfo.length tenantInfo tenantInfo.length i++ i++ i {

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			} {

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			} for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				} int j = 0; int j = 0; j 0 j<tenantInfo[i].length j tenantInfo[i].length tenantInfo[i] tenantInfo i tenantInfo[i].length j++ j++ j {

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				} {

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				} for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					} int k = 0; int k = 0; k 0 k<tenantInfo[i][j].length k tenantInfo[i][j].length tenantInfo[i][j] tenantInfo[i] tenantInfo i j tenantInfo[i][j].length k++ k++ k {
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					} {
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					} output.append(" ") output.append output " " output.append(String.valueOf((tenantInfo[i][j][k]))) output.append output String.valueOf((tenantInfo[i][j][k])) String.valueOf String (tenantInfo[i][j][k]) tenantInfo[i][j] tenantInfo[i] tenantInfo i j k System.out.println(output.toString()) System.out.println System.out System System.out output.toString() output.toString output output.setLength(0) output.setLength output 0 if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				} i!=(tenantInfo.length-1) i (tenantInfo.length-1) tenantInfo.length tenantInfo tenantInfo.length 1 {
					System.out.println("####################");
				} System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main {

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	}
} public class Main {

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	}
} Main

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

public class Main {

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

		// ??\?±???¶???
		int[][][] tenantInfo = new int[4][3][10];

		try {
			// ??\?????¶??°?????\???
			int num = Integer.parseInt(br.readLine());

			// ??\???????????\???
			String str;
			String[] strArr;
			int b,f,r,v;
			for(int i=0;i<num;i++){
				str = br.readLine();
				strArr = str.split(" ");
				b = Integer.parseInt(strArr[0])-1;
				f = Integer.parseInt(strArr[1])-1;
				r = Integer.parseInt(strArr[2])-1;
				v = Integer.parseInt(strArr[3]);

				// ??\?±??????°????¨????
				tenantInfo[b][f][r]+=v;
			}

			// ??????
			StringBuilder output = new StringBuilder();
			for(int i = 0; i<tenantInfo.length; i++){

				for(int j = 0; j<tenantInfo[i].length; j++){

					for(int k = 0; k<tenantInfo[i][j].length; k++){
						output.append(" ");
						output.append(String.valueOf((tenantInfo[i][j][k])));
					}

					// ???????±?????????????
					System.out.println(output.toString());

					// ?????????
					output.setLength(0);
				}
				// ?£???????????????????
				if(i!=(tenantInfo.length-1)){
					System.out.println("####################");
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try{
				if(br != null){
					br.close();
				}
			}catch(IOException ioe){
			}

		}
	}
}