#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rrep(i,n) for(int i=(int)(n)-1; i>=0; i--)
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define pr(a) cout << (a) << endl
#define PR(a,b) cout << (a) << " " << (b) << endl
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000001;
const ll MAXL=1000000000000000001LL;
const ll mod=1000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main() {
  string s;
  bool ck=false;
  while(cin >> s) {
    if(ck) cout << endl;
    ck=true;
    char t[8][5];
    rep(i,8) {
      if(i==2) fill(t[i],t[i]+5,'=');
      else fill(t[i],t[i]+5,'*');
    }
    rep(i,5) {
      if(i>=5-s.size()) {
	int d=(int)s[i+s.size()-5]-'0';
	t[(d/5==0)?1:0][i]=' ';
	t[d%5+3][i]=' ';
      } else {
	t[1][i]=' ';
	t[3][i]=' ';
      }
    }
    rep(i,8) {
      rep(j,5) cout << t[i][j];
      cout << endl;
    }
  }
  return 0;
}
