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

int main(){
	int n,c,a,i,j,count = 0;
	while(cin >> n){
		int b[8][5];
		c = 10000;
		for(i=0;i<5;i++){
			a = n/c;
			if(a<5) b[0][i] = 1;
			else b[1][i] = 1;
			b[2][i] = 2;
			if(a==0||a==5){
				for(j=4;j<8;j++){
					b[j][i] = 1;
				}
			}
			else if(a==1||a==6){
				for(j=3;j<8;j++){
					if(j==4) continue;
					b[j][i] = 1;
				}
			}
			else if(a==2||a==7){
				for(j=3;j<8;j++){
					if(j==5) continue;
					b[j][i] = 1;
				}
			}
			else if(a==3||a==8){
				for(j=3;j<8;j++){
					if(j==6) continue;
					b[j][i] = 1;
				}
			}
			else {
				for(j=3;j<7;j++){
					b[j][i] = 1;
				}
			}
			n -= c*a;
			c /= 10;
		}
		if(count) printf("\n");
		else count++;
		for(i=0;i<8;i++){
			for(j=0;j<5;j++){
				if(b[i][j] == 1) printf("%c",'*');
				else if(b[i][j] == 2) printf("%c",'=');
				else printf("%c",' ');
				b[i][j] = 0;
			}
			printf("\n");
		}
	}
	return 0;
}