import java.util.Scanner;

class Main{
	public static void main(String[] args) 	{
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();
		int apart[][][];
		apart = new int[5][4][11];
		for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		}
		int b,f,r,v;
		for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		}
		for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		}
		sc.close();
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) 	{
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();
		int apart[][][];
		apart = new int[5][4][11];
		for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		}
		int b,f,r,v;
		for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		}
		for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		}
		sc.close();
	}
} Main public static void main(String[] args) 	{
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();
		int apart[][][];
		apart = new int[5][4][11];
		for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		}
		int b,f,r,v;
		for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		}
		for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();
		int apart[][][];
		apart = new int[5][4][11];
		for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		}
		int b,f,r,v;
		for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		}
		for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int data = sc.nextInt(); data sc.nextInt() sc.nextInt sc int apart[][][]; apart apart = new int[5][4][11] apart new int[5][4][11] 5 4 11 for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		} int i = 0 ; int i = 0 ; i 0 i < 5 i 5 i++ i++ i {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		} {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		} for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			} int j = 0 ; int j = 0 ; j 0 j < 4 j 4 j++ j++ j {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			} {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			} for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				} int k = 0 ; int k = 0 ; k 0 k < 11 k 11 k++ k++ k {
					apart[i][j][k] = 0;
				} {
					apart[i][j][k] = 0;
				} apart[i][j][k] = 0 apart[i][j][k] apart[i][j] apart[i] apart i j k 0 int b b f f r r v; v for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		} int i = 0 ; int i = 0 ; i 0 i < data i data i++ i++ i {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		} {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		} b = sc.nextInt() b sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc v = sc.nextInt() v sc.nextInt() sc.nextInt sc apart[b][f][r] += v apart[b][f][r] apart[b][f] apart[b] apart b f r v for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		} int i = 1 ; int i = 1 ; i 1 i <= 4 i 4 i++ i++ i {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		} {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		} for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			} int j = 1 ; int j = 1 ; j 1 j <= 3 j 3 j++ j++ j {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			} {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			} for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				} int k = 1; int k = 1; k 1 k <= 10 k 10 k++ k++ k {
					System.out.printf(" %d",apart[i][j][k]);
				} {
					System.out.printf(" %d",apart[i][j][k]);
				} System.out.printf(" %d",apart[i][j][k]) System.out.printf System.out System System.out " %d" apart[i][j][k] apart[i][j] apart[i] apart i j k System.out.printf("\n") System.out.printf System.out System System.out "\n" if(i == 4) break; i == 4 i 4 break; System.out.printf("####################\n") System.out.printf System.out System System.out "####################\n" sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args) 	{
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();
		int apart[][][];
		apart = new int[5][4][11];
		for(int i = 0 ; i < 5 ; i++) {
			for(int j = 0 ; j < 4 ; j++) {
				for(int k = 0 ; k < 11 ; k++) {
					apart[i][j][k] = 0;
				}
			}
		}
		int b,f,r,v;
		for(int i = 0 ; i < data ; i++) {
			b = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
			v = sc.nextInt();
			apart[b][f][r] += v;
		}
		for(int i = 1 ; i <= 4 ; i++) {
			for(int j = 1 ; j <= 3; j++) {
				for(int k = 1; k <= 10 ; k++) {
					System.out.printf(" %d",apart[i][j][k]);
				}
				System.out.printf("\n");
			}
			if(i == 4) break;
			System.out.printf("####################\n");
		}
		sc.close();
	}
}
