import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	}
} Main public static void main(String[] args){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	} main {
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	} int home[][][] = new int[4][3][10]; home new int[4][3][10] 4 3 10 Scanner std = new Scanner(System.in); std new Scanner(System.in) int n = Integer.parseInt(std.next()); n Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		} {
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		} int b = Integer.parseInt(std.next()); b Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int f = Integer.parseInt(std.next()); f Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int r = Integer.parseInt(std.next()); r Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int v = Integer.parseInt(std.next()); v Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std home[b-1][f-1][r-1] += v home[b-1][f-1][r-1] home[b-1][f-1] home[b-1] home b-1 b 1 f-1 f 1 r-1 r 1 v for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		} int j=0; int j=0; j 0 j<=4-1 j 4-1 4 1 j++ j++ j {
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		} {
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		} for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			} int k=0; int k=0; k 0 k<=3-1 k 3-1 3 1 k++ k++ k {
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			} {
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			} String line = ""; line "" for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				} int l=0; int l=0; l 0 l<=10-1 l 10-1 10 1 l++ l++ l {
					line += " "+home[j][k][l];
				} {
					line += " "+home[j][k][l];
				} line += " "+home[j][k][l] line " "+home[j][k][l] " " home[j][k][l] home[j][k] home[j] home j k l System.out.println(line) System.out.println System.out System System.out line if(j!=3){System.out.println("####################");} j!=3 j 3 {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){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	}
} public class Main {
	public static void main(String[] args){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		int home[][][] = new int[4][3][10];

		Scanner std = new Scanner(System.in);
		int n = Integer.parseInt(std.next());
		for (int i=1; i<=n; i++){
			int b = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			int v = Integer.parseInt(std.next());
			home[b-1][f-1][r-1] += v;
		}
		for (int j=0; j<=4-1; j++){
			for(int k=0; k<=3-1; k++){
				String line = "";
				for(int l=0; l<=10-1; l++){
					line += " "+home[j][k][l];
				}
				System.out.println(line);
			}
			if(j!=3){System.out.println("####################");}
		}
	}
}