import java.io.*;
public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	}
} import java.io.*; io.* java public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	}
} Main public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	} main {
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	} BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int b b f f r r v; v int[][] base = new int[12][10]; base new int[12][10] 12 10 String[] lines; lines for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		} {
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		} lines = br.readLine().split(" ") lines br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b = Integer.parseInt(lines[0]) b Integer.parseInt(lines[0]) Integer.parseInt Integer lines[0] lines 0 f = Integer.parseInt(lines[1]) f Integer.parseInt(lines[1]) Integer.parseInt Integer lines[1] lines 1 r = Integer.parseInt(lines[2]) r Integer.parseInt(lines[2]) Integer.parseInt Integer lines[2] lines 2 v = Integer.parseInt(lines[3]) v Integer.parseInt(lines[3]) Integer.parseInt Integer lines[3] lines 3 if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			} base[((b-1)*3)+(f-1)][r-1]>=0 base[((b-1)*3)+(f-1)][r-1] base[((b-1)*3)+(f-1)] base ((b-1)*3)+(f-1) ((b-1)*3) (b-1) b 1 3 (f-1) f 1 r-1 r 1 0 {
				base[((b-1)*3)+(f-1)][r-1] += v;
			} base[((b-1)*3)+(f-1)][r-1] += v base[((b-1)*3)+(f-1)][r-1] base[((b-1)*3)+(f-1)] base ((b-1)*3)+(f-1) ((b-1)*3) (b-1) b 1 3 (f-1) f 1 r-1 r 1 v {
				base[((b-1)*3)+(f-1)][r-1] = v;
			} base[((b-1)*3)+(f-1)][r-1] = v base[((b-1)*3)+(f-1)][r-1] base[((b-1)*3)+(f-1)] base ((b-1)*3)+(f-1) ((b-1)*3) (b-1) b 1 3 (f-1) f 1 r-1 r 1 v for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		} int i=0; int i=0; i 0 i<12 i 12 i++ i++ i {
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		} {
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		} for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			} int j=0; int j=0; j 0 j<10 j 10 j++ j++ j {
				System.out.print(" "+base[i][j]);
			} {
				System.out.print(" "+base[i][j]);
			} System.out.print(" "+base[i][j]) System.out.print System.out System System.out " "+base[i][j] " " base[i][j] base[i] base i j if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			} (i+1)!=12&&(i+1)%3==0 (i+1)!=12 (i+1) i 1 12 (i+1)%3==0 (i+1)%3 (i+1) i 1 3 0 {
				System.out.println();
				System.out.print("####################");
			} System.out.println() System.out.println System.out System System.out System.out.print("####################") System.out.print System.out System System.out "####################" System.out.println() System.out.println System.out System System.out String[] arg arg public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	}
} public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	}
} Main
import java.io.*;
public class Main
{
	public static void main(String[] arg) throws IOException
	{
		BufferedReader br = 
		new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int b,f,r,v;
		int[][] base = new int[12][10];
		String[] lines;
		for(int i=0;i<N;i++)
		{
			lines = br.readLine().split(" ");
			b = Integer.parseInt(lines[0]);
			f = Integer.parseInt(lines[1]);
			r = Integer.parseInt(lines[2]);
			v = Integer.parseInt(lines[3]);
			if(base[((b-1)*3)+(f-1)][r-1]>=0)
			{
				base[((b-1)*3)+(f-1)][r-1] += v;
			}
			else
			{
				base[((b-1)*3)+(f-1)][r-1] = v;
			}
		}
		for(int i=0;i<12;i++)
		{
			for(int j=0;j<10;j++)
			{
				System.out.print(" "+base[i][j]);
			}

			if((i+1)!=12&&(i+1)%3==0)
			{
				System.out.println();
				System.out.print("####################");
			}
			System.out.println();
		}
	}
}