import java.util.*;
import static java.lang.Integer.parseInt;
class Main{
	static			Scanner		s		= new Scanner(System.in);

	static	final	String		divide	= "####################";
	static			int[][][]	h		= new int[4][3][10];

	public static void main(String[] args){
		s.next();
		while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		}
		output();
	}
	static void output() {
		for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		}
	}
} import java.util.*; util.* java import static java.lang.Integer.parseInt; import static java.lang.Integer.parseInt; import static java.lang.Integer.parseInt; class Main{
	static			Scanner		s		= new Scanner(System.in);

	static	final	String		divide	= "####################";
	static			int[][][]	h		= new int[4][3][10];

	public static void main(String[] args){
		s.next();
		while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		}
		output();
	}
	static void output() {
		for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		}
	}
} Main static			Scanner		s		= new Scanner(System.in); s new Scanner(System.in) static	final	String		divide	= "####################"; divide "####################" static			int[][][]	h		= new int[4][3][10]; h new int[4][3][10] 4 3 10 public static void main(String[] args){
		s.next();
		while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		}
		output();
	} main {
		s.next();
		while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		}
		output();
	} s.next() s.next s while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		} s.hasNext() s.hasNext s {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		} h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next()) h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1] h[parseInt(s.next())-1][parseInt(s.next())-1] h[parseInt(s.next())-1] h parseInt(s.next())-1 parseInt(s.next()) parseInt s.next() s.next s 1 parseInt(s.next())-1 parseInt(s.next()) parseInt s.next() s.next s 1 parseInt(s.next())-1 parseInt(s.next()) parseInt s.next() s.next s 1 parseInt(s.next()) parseInt s.next() s.next s output() output String[] args args static void output() {
		for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		}
	} output {
		for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		}
	} for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		} int j=0; int j=0; j 0 j<h.length j h.length h h.length j++ j++ j {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		} {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		} int[][] hh = h[j]; hh h[j] h j for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			} int[] hhh hh {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			} {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			} for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				} int hhhh hhh {
					System.out.printf(" %d",hhhh);
				} {
					System.out.printf(" %d",hhhh);
				} System.out.printf(" %d",hhhh) System.out.printf System.out System System.out " %d" hhhh System.out.println() System.out.println System.out System System.out if(j!=3)
			System.out.println(divide); j!=3 j 3 System.out.println(divide) System.out.println System.out System System.out divide
import java.util.*;
import static java.lang.Integer.parseInt;
class Main{
	static			Scanner		s		= new Scanner(System.in);

	static	final	String		divide	= "####################";
	static			int[][][]	h		= new int[4][3][10];

	public static void main(String[] args){
		s.next();
		while (s.hasNext()) {
			h[parseInt(s.next())-1][parseInt(s.next())-1][parseInt(s.next())-1]+=parseInt(s.next());
		}
		output();
	}
	static void output() {
		for(int j=0;j<h.length;j++) {
			int[][] hh = h[j];
			for (int[] hhh : hh) {
				for (int hhhh:hhh) {
					System.out.printf(" %d",hhhh);
				}
				System.out.println();
			}
			if(j!=3)
			System.out.println(divide);
		}
	}
}