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("####################");
			
		}

	}
} import java.util.Scanner; Scanner java.util 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("####################");
			
		}

	}
} 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("####################");
			
		}

	} main {
		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("####################");
			
		}

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int[][][] build = new int[5][4][11]; build new int[5][4][11] 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 i = 0; int i = 0; i 0 i < build.length i build.length build build.length i++ i++ 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;
				}
			}
		} {
			for (int j = 0; j < build[i].length; j++)
			{
				for (int j2 = 0; j2 < build[i][j].length; j2++)
				{
					build[i][j][j2] = 0;
				}
			}
		} 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 j = 0; int j = 0; j 0 j < build[i].length j build[i].length build[i] build i build[i].length j++ j++ j {
				for (int j2 = 0; j2 < build[i][j].length; j2++)
				{
					build[i][j][j2] = 0;
				}
			} {
				for (int j2 = 0; j2 < build[i][j].length; j2++)
				{
					build[i][j][j2] = 0;
				}
			} for (int j2 = 0; j2 < build[i][j].length; j2++)
				{
					build[i][j][j2] = 0;
				} int j2 = 0; int j2 = 0; j2 0 j2 < build[i][j].length j2 build[i][j].length build[i][j] build[i] build i j build[i][j].length j2++ j2++ j2 {
					build[i][j][j2] = 0;
				} {
					build[i][j][j2] = 0;
				} build[i][j][j2] = 0 build[i][j][j2] build[i][j] build[i] build i j j2 0 int enterInput = in.nextInt(); enterInput in.nextInt() in.nextInt in int enterBuild; enterBuild int enterRow; enterRow int enterCol; enterCol int enterNum; 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;
		} int i = 0; int i = 0; i 0 i < enterInput i enterInput i++ i++ i {
			enterBuild = in.nextInt();
			enterRow = in.nextInt();
			enterCol = in.nextInt();
			enterNum = in.nextInt();

			build[enterBuild][enterRow][enterCol] += enterNum;
		} {
			enterBuild = in.nextInt();
			enterRow = in.nextInt();
			enterCol = in.nextInt();
			enterNum = in.nextInt();

			build[enterBuild][enterRow][enterCol] += enterNum;
		} enterBuild = in.nextInt() enterBuild in.nextInt() in.nextInt in enterRow = in.nextInt() enterRow in.nextInt() in.nextInt in enterCol = in.nextInt() enterCol in.nextInt() in.nextInt in enterNum = in.nextInt() enterNum in.nextInt() in.nextInt in build[enterBuild][enterRow][enterCol] += enterNum build[enterBuild][enterRow][enterCol] build[enterBuild][enterRow] build[enterBuild] 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("####################");
			
		} int i = 1; int i = 1; i 1 i < build.length i build.length build build.length i++ i++ 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("####################");
			
		} {
			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("####################");
			
		} 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("");
			} int j = 1; int j = 1; j 1 j < build[i].length j build[i].length build[i] build i build[i].length j++ j++ j {
				for (int k = 1; k < build[i][j].length; k++)
				{
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println("");
			} {
				for (int k = 1; k < build[i][j].length; k++)
				{
					System.out.print(" " + build[i][j][k]);
				}
				System.out.println("");
			} for (int k = 1; k < build[i][j].length; k++)
				{
					System.out.print(" " + build[i][j][k]);
				} int k = 1; int k = 1; k 1 k < build[i][j].length k build[i][j].length build[i][j] build[i] build i j build[i][j].length k++ k++ k {
					System.out.print(" " + build[i][j][k]);
				} {
					System.out.print(" " + build[i][j][k]);
				} System.out.print(" " + build[i][j][k]) System.out.print System.out System System.out " " + build[i][j][k] " " build[i][j][k] build[i][j] build[i] build i j k System.out.println("") System.out.println System.out System System.out "" if (i < build.length - 1)
				System.out.println("####################"); i < build.length - 1 i build.length - 1 build.length build build.length 1 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args 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("####################");
			
		}

	}
} 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("####################");
			
		}

	}
} Main
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("####################");
			
		}

	}
}