#include<iostream>
#include<cstdio>
#include<string>
using namespace std;int main(){int i,j=0;string s,l[2]={" ","*"};char x[6];while(cin>>i){if(j)cout<<endl;sprintf(x,"%05d",i);for(j=5;j-->0;)x[j]-='0';s="";while(j++<1){for(i=0;i<5;i++)s+=l[j+(x[i]<5)&1];s+="\n";}for(j=5;j-->0;)s+="=";s+="\n";while(j++<4){for(i=0;i<5;i++)s+=l[x[i]%5!=j];s+="\n";}cout<<s;}return 0;}