#include<iostream>
#include<cstdio>
#include<string>
using namespace std;int i,j;main(){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';for(s="";j++<1;s+="\n")for(i=0;i++<5;)s+=l[j+(x[i]<5)&1];for(j=5;j-->0;)s+="=";for(s+="\n";j++<4;s+="\n")for(i=0;i<5;i++)s+=l[x[i]%5!=j];cout<<s;}return 0;}