import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;


public class Problem3 {

	public static void printIt(PrintWriter pw, int p[][], int num)
	{
		for (int i=0; i<p.length; i++)
		{
			for (int j=0; j<p[i].length; j++)
			{
				if (p[i][j] > num)
				{
					pw.print(".");
				} else {
					pw.print(p[i][j]);
				}
			}
			pw.println();
		}		
	}
	
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(new FileReader("data4.txt"));
		//Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(new FileWriter("out4.txt"));

		// Patterns
		int p1[][] = {{0}, {1}};
		int p2[][] = {{0, 3}, {1, 2}};
		int p3[][] = {{5, 4}, {0, 3}, {1, 2}};
		int p4[][] = {{6, 5, 4}, {7, 0, 3}, {8, 1, 2}};
		int p5[][] = {{6, 5, 4}, {7, 0, 3}, {8, 1, 2}, {9, 10, 11} };
		int p6[][] = {{6, 5, 4, 15}, {7, 0, 3, 14}, {8, 1, 2, 13}, {9, 10, 11, 12} };
		int p7[][] = {{19, 18, 17, 16}, {6, 5, 4, 15}, {7, 0, 3, 14}, {8, 1, 2, 13}, {9, 10, 11, 12} };
		int p8[][] = {{20, 19, 18, 17, 16}, {21, 6, 5, 4, 15}, {22, 7, 0, 3, 14}, {23, 8, 1, 2, 13}, {24, 9, 10, 11, 12} };
		
		for (int i=0; i<5; i++)
		{
			int ans = sc.nextInt();
			
			if (ans == 0)
			{
				pw.println(0);
			}
			else if (ans <= 1)
			{
				printIt(pw, p1, ans);
			}
			else if (ans <= 3)
			{
				printIt(pw, p2, ans);
			}
			else if (ans <=5)
			{
				printIt(pw, p3, ans);
			}
			else if (ans <=8)
			{
				printIt(pw, p4, ans);
			}
			else if (ans <=11)
			{
				printIt(pw, p5, ans);
			}
			else if (ans <=15)
			{
				printIt(pw, p6, ans);
			}
			else if (ans <=19)
			{
				printIt(pw, p7, ans);
			}
			else if (ans <=20)
			{
				printIt(pw, p8, ans);
			}
			
		}
		
		pw.close();

	}

}

