#include <vector>
#include <algorithm>
#include <iostream>
#include <functional>
#include <string>

using namespace std;

int main() {
    int n = 0;
    int N[5] = {0};
    cin >> n;
    cout << "\n";
    
    N[0] = n / 10000;
    n %= 10000;
    N[1] = n / 1000;
    n %= 1000;
    N[2] = n / 100;
    n %= 100;
    N[3] = n / 10;
    n %= 10;
    N[4] = n;
    
        for(int i = 0; i < 8; i++) {
            for (int j = 0; j < 5; j++) {
                if(i == 0) {
                    if (N[j] < 5) cout << "*";
                    else cout << " ";
                }
                if(i == 1) {
                    if (N[j] < 5) cout << " ";
                    else cout << "*";
                }

                if(i == 2) cout << "=";

                if(i == 3) {
                    if (N[j] > 4) N[j] -= 5;
                    if (N[j] != 0) cout << "*";
                    else cout << " ";
                }

                if(i == 4) {
                    if (N[j] != 1) cout << "*";
                    else cout << " ";
                }

                if(i == 5) {
                    if (N[j] != 2) cout << "*";
                    else cout << " ";
                }
                if(i == 6) {
                    if (N[j] != 3) cout << "*";
                    else cout << " ";
                }
                if(i == 7) {
                    if (N[j] != 4) cout << "*";
                    else cout << " ";
                }

                if (j == 4) cout << "\n";
            }
        }
    return 0;
}