#include<iostream>
using namespace std;

string abacus(int x){
  string res;
  if(x<5)res += "* =";
  else res += " *=";

  if(x%5 == 0)res += " ****";
  if(x%5 == 1)res += "* ***";
  if(x%5 == 2)res += "** **";
  if(x%5 == 3)res += "*** *";
  if(x%5 == 4)res += "**** ";
  return res;
}
int main(){
  int x;

  while(cin>>x){
    string ans[5];
    for(int i=4;i>=0;i--){
      ans[i] = abacus(x%10);
      x /= 10;
    }
 
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++)cout << ans[j][i];
      cout << endl;
    }
    cout << endl;
  }
}