import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);

		int[][][] build = new int[5][4][11];
		for (int i = 0; i < build.length; i++)
		{
			for (int j = 0; j < build[i].length; j++)
			{
				for (int j2 = 0; j2 < build[i][j].length; j2++)
				{
					build[i][j][j2] = 0;
				}
			}
		}

		int enterInput = in.nextInt();
		int enterBuild;
		int enterRow;
		int enterCol;
		int enterNum;

		for (int i = 0; i < enterInput; i++)
		{
			enterBuild = in.nextInt();
			enterRow = in.nextInt();
			enterCol = in.nextInt();
			enterNum = in.nextInt();

			build[enterBuild][enterRow][enterCol] += enterNum;
		}

		for (int i = 1; i < build.length; i++)
		{
			for (int j = 1; j < build[i].length; j++)
			{
				for (int k = 1; k < build[i][j].length; k++)
				{
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println("");
			}
			if (i < build.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