3AC,2WA
#include <bits/stdc++.h>
using namespace std;
string db[5][10] = {"XXX","..X","XXX","XXX","X.X","XXX","XXX","XXX","XXX","XXX",
"X.X","..X","..X","..X","X.X","X..","X..","..X","X.X","X.X",
"X.X","..X","XXX","XXX","XXX","XXX","XXX","..X","XXX","XXX",
"X.X","..X","X..","..X","..X","..X","X.X","..X","X.X","..X",
"XXX","..X","XXX","XXX","..X","XXX","XXX","..X","XXX","XXX"};
int main(){
int n;
cin>>n;
int num;
cin>>num;
int a[101] = {};
for(int i = 0;i<n;++i){
a[i] = num%10;
num/=10;
}
for(int i = 0;i<=4;++i){
for(int j = n-1;j>=0;--j){
cout<<db[i][a[j]];
if(j){
cout<<'.';
}
}
cout<<endl;
}
return 0;
}