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

public class Main{

	public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{

	public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	}
} Main public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	} main {
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	} int[][] room = new int[12][10]; room new int[12][10] 12 10 int i i j j n n x x y; y BufferedReader br = new BufferedReader(new InputStreamReader(System.in) ); br new BufferedReader(new InputStreamReader(System.in) ) n = Integer.parseInt(br.readLine() ) n Integer.parseInt(br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br int[] b = new int[n]; b new int[n] n int[] f = new int[n]; f new int[n] n int[] r = new int[n]; r new int[n] n int[] v = new int[n]; v new int[n] n for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		} i=0; i=0 i 0 i<n i n i++ i++ i {
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		} {
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " b[i] = Integer.parseInt(str[0]) b[i] b i Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 f[i] = Integer.parseInt(str[1]) f[i] f i Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 r[i] = Integer.parseInt(str[2]) r[i] r i Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 v[i] = Integer.parseInt(str[3]) v[i] v i Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 x = f[i] + 3*(b[i]-1) x f[i] + 3*(b[i]-1) f[i] f i 3*(b[i]-1) 3 (b[i]-1) b[i] b i 1 y = r[i] y r[i] r i room[x-1][y-1] += v[i] room[x-1][y-1] room[x-1] room x-1 x 1 y-1 y 1 v[i] v i for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

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

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

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		} for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			} j=0; j=0 j 0 j<10 j 10 j++ j++ j {
				System.out.print(" " + room[i][j]);
			} {
				System.out.print(" " + room[i][j]);
			} System.out.print(" " + room[i][j]) System.out.print System.out System System.out " " + room[i][j] " " room[i][j] room[i] room i j System.out.println() System.out.println System.out System System.out if( (i+1)%3==0 && i<11) System.out.println("####################"); (i+1)%3==0 && i<11 (i+1)%3==0 (i+1)%3 (i+1) i 1 3 0 i<11 i 11 System.out.println("####################") System.out.println System.out System System.out "####################" String[] args args public class Main{

	public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	}
} public class Main{

	public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws IOException
	{
		int[][] room = new int[12][10];
		int i,j,n,x,y;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		n = Integer.parseInt(br.readLine() );//input n

		int[] b = new int[n];
		int[] f = new int[n];
		int[] r = new int[n];
		int[] v = new int[n];

		for(i=0; i<n; i++)
		{
			String[] str = br.readLine().split(" ");

			b[i] = Integer.parseInt(str[0]);
			f[i] = Integer.parseInt(str[1]);
			r[i] = Integer.parseInt(str[2]);
			v[i] = Integer.parseInt(str[3]);

			x = f[i] + 3*(b[i]-1);
			y = r[i];

			room[x-1][y-1] += v[i];
		}

		for(i=0; i<12; i++)
		{
			for(j=0; j<10; j++)
			{
				System.out.print(" " + room[i][j]);
			}

			System.out.println();
			if( (i+1)%3==0 && i<11) System.out.println("####################");
		}

	}
}