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

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	}
} 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[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	}
} Main public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() String input = br.readLine(); input br.readLine() br.readLine br int n = Integer.parseInt(input); n Integer.parseInt(input) Integer.parseInt Integer input int i = 0; i 0 int j = 0; j 0 int k = 0; k 0 int room[][][] = new int[4][3][10]; room new int[4][3][10] 4 3 10 for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		} i=0 ; i=0 i 0 i<4 i 4 i++ i++ i {
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		} {
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		} for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			} j=0 ; j=0 j 0 j<3 j 3 j++ j++ j {
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			} {
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			} for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				} k=0 ; k=0 k 0 k<10 k 10 k++ k++ k {
					room[i][j][k]=0;
				} {
					room[i][j][k]=0;
				} room[i][j][k]=0 room[i][j][k] room[i][j] room[i] room i j k 0 for( i=0 ; i<n ; i++){
			String[] reinput = br.readLine().split(" ");
			int b = Integer.parseInt(reinput[0])-1;
			int f = Integer.parseInt(reinput[1])-1;
			int r = Integer.parseInt(reinput[2])-1;
			int v = Integer.parseInt(reinput[3]);
			room[b][f][r] = room[b][f][r] + v;
		} i=0 ; i=0 i 0 i<n i n i++ i++ i {
			String[] reinput = br.readLine().split(" ");
			int b = Integer.parseInt(reinput[0])-1;
			int f = Integer.parseInt(reinput[1])-1;
			int r = Integer.parseInt(reinput[2])-1;
			int v = Integer.parseInt(reinput[3]);
			room[b][f][r] = room[b][f][r] + v;
		} {
			String[] reinput = br.readLine().split(" ");
			int b = Integer.parseInt(reinput[0])-1;
			int f = Integer.parseInt(reinput[1])-1;
			int r = Integer.parseInt(reinput[2])-1;
			int v = Integer.parseInt(reinput[3]);
			room[b][f][r] = room[b][f][r] + v;
		} String[] reinput = br.readLine().split(" "); reinput br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int b = Integer.parseInt(reinput[0])-1; b Integer.parseInt(reinput[0])-1 Integer.parseInt(reinput[0]) Integer.parseInt Integer reinput[0] reinput 0 1 int f = Integer.parseInt(reinput[1])-1; f Integer.parseInt(reinput[1])-1 Integer.parseInt(reinput[1]) Integer.parseInt Integer reinput[1] reinput 1 1 int r = Integer.parseInt(reinput[2])-1; r Integer.parseInt(reinput[2])-1 Integer.parseInt(reinput[2]) Integer.parseInt Integer reinput[2] reinput 2 1 int v = Integer.parseInt(reinput[3]); v Integer.parseInt(reinput[3]) Integer.parseInt Integer reinput[3] reinput 3 room[b][f][r] = room[b][f][r] + v room[b][f][r] room[b][f] room[b] room b f r room[b][f][r] + v room[b][f][r] room[b][f] room[b] room b f r v for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		} i=0 ; i=0 i 0 i<4 i 4 i++ i++ i {
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		} {
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		} for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			} j=0 ; j=0 j 0 j<3 j 3 j++ j++ j {
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			} {
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			} for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				} k=0 ; k=0 k 0 k<10 k 10 k++ k++ k {
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				} {
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				} sb.append(" ").append(Integer.toString(room[i][j][k])) sb.append(" ").append sb.append(" ") sb.append sb " " Integer.toString(room[i][j][k]) Integer.toString Integer room[i][j][k] room[i][j] room[i] room i j k sb.append("\n") sb.append sb "\n" if( i==3 ) break; i==3 i 3 break; sb.append("####################\n") sb.append sb "####################\n" System.out.print(sb) System.out.print System.out System System.out sb String[] age age public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	}
} public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		String input = br.readLine();
		int n = Integer.parseInt(input);
		int i = 0;
		int j = 0;
		int k = 0;

		int room[][][] = new int[4][3][10];
		for( i=0 ; i<4; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for ( k=0 ; k<10 ; k++ ){
					room[i][j][k]=0;
				}
			}
		}

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

		for( i=0 ; i<4 ; i++ ){
			for( j=0 ; j<3 ; j++ ){
				for( k=0 ; k<10 ; k++ ){
					sb.append(" ").append(Integer.toString(room[i][j][k]));
				}
				sb.append("\n");
			}
			if( i==3 ) break;
			sb.append("####################\n");
		}

		System.out.print(sb);
	}
}