#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s;
  int flag = 0;
  while (cin >> s) {
    if (flag++) cout << endl;
    while (int(s.size()) < 5) s = "0" + s;
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 5; j++) {
        cout << " *"[i ^ ((s[j] - '0') / 5 == 0)];
      }
      cout << endl;
    }
    for (int i = 0; i < 5; i++) {
      cout << "=";
    }
    cout << endl;
    for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 5; j++) {
        cout << " *"[(s[j] - '0') % 5 != i];
      }
      cout << endl;
    }
  }

  return 0;
}
