import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[][][] house = new int[3][10][4];
		String count = br.readLine();
		for(int i = 0 ; i < Integer.parseInt(count) ; i++){
			String info = br.readLine();
			String[] ia = info.split(" ");
			house[Integer.parseInt(ia[1])-1][Integer.parseInt(ia[2])-1][Integer.parseInt(ia[0])-1] += Integer.parseInt(ia[3]);
			                                                         
		}
		for(int i = 0 ; i < house[2][0].length ; i++){
			for(int j = 0 ; j < house.length ; j++){
				for(int k = 0 ; k < house[j].length ; k++){
					System.out.print(" " + house[j][k][i]);
				}
				System.out.println();
			}
			if(i != house[0][0].length-1) System.out.println("####################");
		}
	}

}
/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