#include<algorithm>
#include<iostream>
#include<string>
using namespace std;
int main(){
  int h=0,i;
  int len;
  for(;;){
    string s;
    cin>>s;
    if(s.empty())
      break;
    len=s.length();
    if(h)
      cout<<endl;
    h=1;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')/5)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<" ";
    for(i=0;i<len;i++){
      if((s[i]-'0')/5)
	cout<<"*";
      else
	cout<<" ";
    }
    cout<<endl<<"====="<<endl;
    for(i=0;i<5-len;i++)
      cout<<" ";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==0)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==1)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==2)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==3)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
    for(i=0;i<5-len;i++)
      cout<<"*";
    for(i=0;i<len;i++){
      if((s[i]-'0')%5==4)
	cout<<" ";
      else
	cout<<"*";
    }
    cout<<endl;
  }
  return 0;
}