#include <iostream>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

int main(void){
	int n;
	
	while(cin >> n){
		int d[5];
		
		for(int i=4;i>=0;i--){
			d[4-i] = (int)(n / pow(10, i)) % 10;
		}
		
		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				if(i == 0){
					if(d[j] / 5 == 0){
						cout << "*";
					}else{
						cout << " ";
					}
				}else if(i == 1){
					if(d[j] / 5 == 1){
						cout << "*";
					}else{
						cout << " ";
					}
				}else if(i == 2){
					cout << "=";
				}else if(i == 3){
					if(d[j] % 5 == 0){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 4){
					if(d[j] % 5 == 1){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 5){
					if(d[j] % 5 == 2){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 6){
					if(d[j] % 5 == 3){
						cout << " ";
					}else{
						cout << "*";
					}
				}else if(i == 7){
					if(d[j] % 5 == 4){
						cout << " ";
					}else{
						cout << "*";
					}
				}
			}
			cout << endl;
		}
	}
}