#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()


int main() {
  string hoge[] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** ",
                   " *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** ",};
  int n;
  int f = 0;
  while(cin>>n) {
    if (f) cout << endl; else f++;
    vector<string> ans(5);
    REP(i,5) {
      ans[i] = hoge[n%10];
      n/=10;
    }
    reverse(ALL(ans));
    REP(y,8) {
      REP(x,5) {
        cout << ans[x][y];
      }
      cout << endl;
    }
  }
}