import java.io.*;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int[][][] houses = new int[4][3][10];
		int n = Integer.parseInt(in.readLine());
		for (int i = 0; i < n; i += 1) {
			String[] info = in.readLine().split(" ");
			int b = Integer.parseInt(info[0]);
			int f = Integer.parseInt(info[1]);
			int r = Integer.parseInt(info[2]);
			int v = Integer.parseInt(info[3]);
			houses[b - 1][f - 1][r - 1] += v;
		}
		for (int x = 0; x < 4; x += 1) {
			for (int y = 0; y < 3; y += 1) {
				for (int z = 0; z < 10; z += 1) {
					sb.append(" ");
					sb.append(houses[x][y][z]);
				}
				sb.append(System.getProperty("line.separator"));
			}
			if (x != 3) {
				sb.append("####################"
						+ System.getProperty("line.separator"));
			}
		}
		System.out.print(sb);
	}
}
/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