#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

string s5[2];
string s[5];
string bar;

const int FIVE = 0, N = 5;

int main()
{
    int n, k;
    bool sec = false;
    bar = "=====";

    while(cin >> n)
    {
        REP(5) s[i] = "*****";
        REP(2) s5[i] = "*****";
        REP(5)
        {
            k = n % 10;
            if(k >= 5) { s5[FIVE][N - i - 1] = ' '; k -= 5;}
            else {s5[!FIVE][N - i - 1] = ' ';}

            s[k][N - i - 1] = ' ';
            
            n = n / 10;
        }
        if(sec) cout << endl;

        REP(2) cout << s5[i] << endl;
        cout << bar << endl;
        REP(5) cout << s[i] << endl;
        sec = true;

    }
    return 0;
}