import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	}

}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	}

} Main public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	} main {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) int n=in.nextInt() n in.nextInt() in.nextInt in A[][][]=new int[4][3][10]; A new int[4][3][10] 4 3 10 for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		} {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		} int b=Integer.parseInt(in.next()) b Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in f=Integer.parseInt(in.next()) f Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in r=Integer.parseInt(in.next()) r Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in v=Integer.parseInt(in.next()); v Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in A[b-1][f-1][r-1]+=v A[b-1][f-1][r-1] A[b-1][f-1] A[b-1] A b-1 b 1 f-1 f 1 r-1 r 1 v for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)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++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		} {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		} for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			} {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			} for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				} int k=0; int k=0; k 0 k<10 k 10 k++ k++ k {
					out.print(" "+A[i][j][k]);
				} {
					out.print(" "+A[i][j][k]);
				} out.print(" "+A[i][j][k]) out.print out " "+A[i][j][k] " " A[i][j][k] A[i][j] A[i] A i j k out.println() out.println out if(i<3)out.println("####################"); i<3 i 3 out.println("####################") out.println out "####################" out.flush() out.flush out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	}

} Main
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=in.nextInt(),A[][][]=new int[4][3][10];
		for(int i=0;i<n;i++) {
			int b=Integer.parseInt(in.next()), f=Integer.parseInt(in.next()), r=Integer.parseInt(in.next()), v=Integer.parseInt(in.next());
			A[b-1][f-1][r-1]+=v;
		}
		
		for(int i=0;i<4;i++) {
			for(int j=0;j<3;j++) {
				for(int k=0;k<10;k++) {
					out.print(" "+A[i][j][k]);
				}
				out.println();
			}
			if(i<3)out.println("####################");
		}
		out.flush();
	}

}

