#include <iostream>
#include <string>
using namespace std;

string soroban[8] = {"*****     ", "     *****", "==========",
                     " **** ****", "* **** ***", "** **** **",
                     "*** **** *", "**** **** "};

int main() {
    string s;
    int count = 0;
    while (cin >> s) {
        int diff = 5 - s.size();
        string t;
        for (int i = 0; i < diff; i++) {
            t.push_back('0');
        }
        t += s;

        if (count) cout << endl;
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 5; j++) {
                cout << soroban[i][t[j] - '0'];
            }
            cout << endl;
        }
        count++;
    }
}