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

public class Main
{
	public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main
{
	public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	} main {
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	} try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		} catch (Exception e)
		{
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[][][] dom = new int[4][3][10]; dom new int[4][3][10] 4 3 10 String[] bfrv = new String[4]; bfrv new String[4] 4 int b=0 b 0 f=0 f 0 r=0 r 0 v=0; v 0 for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			} int i=0; int i=0; i 0 i<num i num i++ i++ i {
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			} {
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			} bfrv = br.readLine().split(" ") bfrv br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b=Integer.parseInt(bfrv[0]) b Integer.parseInt(bfrv[0]) Integer.parseInt Integer bfrv[0] bfrv 0 f=Integer.parseInt(bfrv[1]) f Integer.parseInt(bfrv[1]) Integer.parseInt Integer bfrv[1] bfrv 1 r=Integer.parseInt(bfrv[2]) r Integer.parseInt(bfrv[2]) Integer.parseInt Integer bfrv[2] bfrv 2 v=Integer.parseInt(bfrv[3]) v Integer.parseInt(bfrv[3]) Integer.parseInt Integer bfrv[3] bfrv 3 dom[b-1][f-1][r-1] += v dom[b-1][f-1][r-1] dom[b-1][f-1] dom[b-1] dom b-1 b 1 f-1 f 1 r-1 r 1 v for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			} int b1=0; int b1=0; b1 0 b1<4 b1 4 b1++ b1++ b1 {
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			} {
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			} for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				} int f1=0; int f1=0; f1 0 f1<3 f1 3 f1++ f1++ f1 {
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				} {
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				} for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					} int r1=0; int r1=0; r1 0 r1<10 r1 10 r1++ r1++ r1 {
						System.out.print(" " + dom[b1][f1][r1]);
					} {
						System.out.print(" " + dom[b1][f1][r1]);
					} System.out.print(" " + dom[b1][f1][r1]) System.out.print System.out System System.out " " + dom[b1][f1][r1] " " dom[b1][f1][r1] dom[b1][f1] dom[b1] dom b1 f1 r1 System.out.println() System.out.println System.out System System.out if(b1!=3)	System.out.println("####################"); b1!=3 b1 3 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main
{
	public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} public class Main
{
	public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{
	public static void main(String[] args)
	{
		try
		{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int num = Integer.parseInt(br.readLine());

			int[][][] dom = new int[4][3][10];
			String[] bfrv = new String[4];
			int b=0, f=0, r=0, v=0;
			for(int i=0; i<num; i++)
			{
				bfrv = br.readLine().split(" ");
				b=Integer.parseInt(bfrv[0]);
				f=Integer.parseInt(bfrv[1]);
				r=Integer.parseInt(bfrv[2]);
				v=Integer.parseInt(bfrv[3]);
				dom[b-1][f-1][r-1] += v;
			}
			for(int b1=0; b1<4; b1++)
			{
				for(int f1=0; f1<3; f1++)
				{
					for(int r1=0; r1<10; r1++)
					{
						System.out.print(" " + dom[b1][f1][r1]);
					}
					System.out.println();
				}
				if(b1!=3)	System.out.println("####################");
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}