#include<cstdio>
#include<string>
#include<iostream>

using namespace std;

int main()
{
	char n[10][9]={"* = ****","* =* ***","* =** **","* =*** *","* =**** ",
				   " *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	int a;
	for(int k=0;cin>>a;k++){
		if(k>0)	cout<<endl;

		char s[6];
		sprintf(s,"%05d",a);

		char abacus[8][6];
		for(int i=0;i<5;i++){
			for(int j=0;j<8;j++){
				abacus[j][i]=n[s[i]-'0'][j];
			}
		}

		for(int i=0;i<8;i++){
			for(int j=4;j>=0;j--){
				if(abacus[i][j]!=' ')	break;
				abacus[i][j]='\0';
			}
		}

		for(int i=0;i<8;i++){
			for(int j=0;j<5;j++){
				cout<<abacus[i][j];
			}
			cout<<endl;
		}
	}

	return 0;
}