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

public class Main {
	public static void main(String[] args) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	}
} 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) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	}
} Main public static void main(String[] args) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	} main {
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	} int n n b b f f r r v; v String[] list; list int[][][] building; building StringBuilder builder = new StringBuilder(); builder new StringBuilder() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br building = new int[4][3][10] building new int[4][3][10] 4 3 10 for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		} {
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		} list = br.readLine().split(" ") list br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b = Integer.parseInt(list[0]) b Integer.parseInt(list[0]) Integer.parseInt Integer list[0] list 0 f = Integer.parseInt(list[1]) f Integer.parseInt(list[1]) Integer.parseInt Integer list[1] list 1 r = Integer.parseInt(list[2]) r Integer.parseInt(list[2]) Integer.parseInt Integer list[2] list 2 v = Integer.parseInt(list[3]) v Integer.parseInt(list[3]) Integer.parseInt Integer list[3] list 3 building[b - 1][f - 1][r - 1] += v building[b - 1][f - 1][r - 1] building[b - 1][f - 1] building[b - 1] building b - 1 b 1 f - 1 f 1 r - 1 r 1 v for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		} {
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		} if(i != 0)builder.append("####################\n"); i != 0 i 0 builder.append("####################\n") builder.append builder "####################\n" for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			} {
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			} for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					builder.append(" " + building[i][j][k]);
				} {
					builder.append(" " + building[i][j][k]);
				} builder.append(" " + building[i][j][k]) builder.append builder " " + building[i][j][k] " " building[i][j][k] building[i][j] building[i] building i j k builder.append("\n") builder.append builder "\n" builder.delete(builder.length() -1 , builder.length()) builder.delete builder builder.length() -1 builder.length() builder.length builder 1 builder.length() builder.length builder System.out.println(builder) System.out.println System.out System System.out builder br.close() br.close br String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		int n, b,f,r,v;
		String[] list;
		int[][][] building;
		StringBuilder builder = new StringBuilder();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		building = new int[4][3][10];
		for(int i=0; i<n; i++){
			list = br.readLine().split(" ");
			b = Integer.parseInt(list[0]);
			f = Integer.parseInt(list[1]);
			r = Integer.parseInt(list[2]);
			v = Integer.parseInt(list[3]);
			building[b - 1][f - 1][r - 1] += v;
		}
		for(int i = 0; i < 4; i++){
			if(i != 0)builder.append("####################\n");
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 10; k++){
					builder.append(" " + building[i][j][k]);
				}
				builder.append("\n");
			}
		}
		builder.delete(builder.length() -1 , builder.length());
		System.out.println(builder);
		br.close();
	}
}