import java.io.IOException;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	}
} Main public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int[][][] array = new int[4][3][10]; array new int[4][3][10] 4 3 10 for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		} int i=0; int i=0; i 0 i<x i x i++ i++ i {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		} {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		} int t = sc.nextInt(); t sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc array[t-1][k-1][b-1] += p array[t-1][k-1][b-1] array[t-1][k-1] array[t-1] array t-1 t 1 k-1 k 1 b-1 b 1 p for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		} int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		} {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		} for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			} {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			} for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					System.out.print(" " + array[i][j][k]);
				} {
					System.out.print(" " + array[i][j][k]);
				} System.out.print(" " + array[i][j][k]) System.out.print System.out System System.out " " + array[i][j][k] " " array[i][j][k] array[i][j] array[i] array i j k System.out.println() System.out.println System.out System System.out if(i!=4-1) {
				System.out.println("####################");
			} i!=4-1 i 4-1 4 1 {
				System.out.println("####################");
			} System.out.println("####################") System.out.println System.out System System.out "####################" sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	}
} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws IOException{
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int[][][] array = new int[4][3][10];
		for(int i=0;i<x;i++) {
			int t = sc.nextInt();
			int k = sc.nextInt();
			int b = sc.nextInt();
			int p = sc.nextInt();
			array[t-1][k-1][b-1] += p;
		}

		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					System.out.print(" " + array[i][j][k]);
				}
				System.out.println();
			}
			if(i!=4-1) {
				System.out.println("####################");
			}
		}
		sc.close();
	}
}
