#include<iostream>
using namespace std;

int main()
{
    int n;
    char a[8][10], b[8][5];
    for( int i = 0; i < 8; i++ )
        for( int j = 0; j < 10; j++ )
            a[i][j] = '*';

    for( int i = 0; i < 8; i++ )
        for( int j = 0; j < 10; j++ )
        {
            a[2][j] = '=';
            if( j / 5 == 1 )
                a[0][j] = ' ';
            else
                a[1][j] = ' ';
        }

    for( int i = 3; i < 8; i++ )
    {
        a[i][i-3] = ' ';
        a[i][i+2] = ' ';
    }

    bool judge = false;
    while( cin >> n )
    {
        if( judge )
            cout << endl;

        int c = 5;
        while( c-- )
        {
            for( int i = 0; i < 8; i++ )
                b[i][c] = a[i][n%10];
            n /= 10;
        }
        for( int i = 0; i < 8; i++ )
        {
            for( int j = 0; j < 5; j++ )
                cout << b[i][j];
            cout << endl;
        }
        judge = true;
    }
    return 0;
}

