#include<iostream>
using namespace std;
char res[10][400];
char tmp[5][30]=
{
'X','X','X','.','.','X','X','X','X','X','X','X','X','.','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
'X','.','X','.','.','X','.','.','X','.','.','X','X','.','X','X','.','.','X','.','.','.','.','X','X','.','X','X','.','X',
'X','.','X','.','.','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X',
'X','.','X','.','.','X','X','.','.','.','.','X','.','.','X','.','.','X','X','.','X','.','.','X','X','.','X','.','.','X',
'X','X','X','.','.','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X',
};
int main()
{
int n;
cin>>n;
char num[110];
int i=0;
int count=0;
while(n--)
{
int x;
scanf("%1d",&x);
int a=0,b=0;
switch (x)
{
case 0:a=0,b=2;break;
case 1:a=3,b=5;break;
case 2:a=6,b=8;break;
case 3:a=9,b=11;break;
case 4:a=12,b=14;break;
case 5:a=15,b=17;break;
case 6:a=18,b=20;break;
case 7:a=21,b=23;break;
case 8:a=24,b=26;break;
case 9:a=27,b=29;break;
}
for(int i=0;i<5;i++)
{
for(int j=a;j<=b;j++)
{
res[i][count++]=tmp[i][j];
}
count=count-2;
}
count=count+3;
if(n!=0)
{
for(int i=0;i<5;i++)
res[i][count]='.';
}
count++;
}
for(int i=0;i<5;i++)
{
for(int j=0;j<=count;j++)
cout<<res[i][j];
cout<<endl;
}
system("pause");
return 0;
}