import java.util.Scanner;
public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	}
} Main public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	} main {
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) int[][][] bd = new int[4][3][10]; bd new int[4][3][10] 4 3 10 int n = input.nextInt(); n input.nextInt() input.nextInt input int a a b b c c d; d for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		} {
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		} a = input.nextInt() a input.nextInt() input.nextInt input b = input.nextInt() b input.nextInt() input.nextInt input c = input.nextInt() c input.nextInt() input.nextInt input d = input.nextInt() d input.nextInt() input.nextInt input bd[a-1][b-1][c-1] += d bd[a-1][b-1][c-1] bd[a-1][b-1] bd[a-1] bd a-1 a 1 b-1 b 1 c-1 c 1 d for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		} int i = 0; int i = 0; i 0 i < 4 i 4 i++ i++ i {
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		} {
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		} for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			} {
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			} for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				} int k = 0; int k = 0; k 0 k < 10 k 10 k++ k++ k {
					System.out.print(" " + bd[i][j][k]);
				} {
					System.out.print(" " + bd[i][j][k]);
				} System.out.print(" " + bd[i][j][k]) System.out.print System.out System System.out " " + bd[i][j][k] " " bd[i][j][k] bd[i][j] bd[i] bd i j k System.out.println() System.out.println System.out System System.out if(i < 3)
				System.out.println("####################"); i < 3 i 3 System.out.println("####################") System.out.println System.out System System.out "####################" String args[] args public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	}
} public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	}
} Main
import java.util.Scanner;
public class Main
{
	public static void main( String args[] )
	{
		Scanner input = new Scanner(System.in);
		int[][][] bd = new int[4][3][10];
		int n = input.nextInt();
		int a, b, c, d;
		for(int i = 0; i < n; i++)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			d = input.nextInt();
			bd[a-1][b-1][c-1] += d;
		}
		for(int i = 0; i < 4; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				for(int k = 0; k < 10; k++)
				{
					System.out.print(" " + bd[i][j][k]);
				}
				System.out.println();
			}
			if(i < 3)
				System.out.println("####################");
		}
	}
}