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);
		}
	}
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz