#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,s,b) for(int i=(s);i<(b);i++)
#define rrep(i,s,b) for(int i=(b)-1;i>=(s);i--)
#define all(s) (s).begin(),(s).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	for (int n, cnt = 0; cin >> n; cnt++) {
		if (cnt)cout << endl;
		string s[5] = {};
		rep(i, 0, 5) {
			int a = n % 10;
			if (a >= 5)s[i] += " *=";
			else s[i] += "* =";
			a %= 5;
			rep(j, 0, 5) {
				if (j == a) s[i] += " ";
				s[i] += "*";
			}
			n /= 10;
		}
		rep(h, 0, s[0].size()) {
			string ans = "";
			//bool flag = true;
			rep(i, 0, 5) {
				//if (flag&&s[i][h] == ' ')continue;
				//flag = false;
				ans = s[i][h] + ans;
			}
			cout << ans << endl;
		}
	}
	return 0;
}