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

int main(){
	bool f=false;
	int n,i,j;
	int a[6];
	char a0[11][10]={"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	cin>>n;
	while(n!=EOF){
		if(f==true) cout<<endl;
	a[0]=n/10000;
	a[1]=(n-a[0]*10000)/1000;
	a[2]=(n-a[0]*10000-a[1]*1000)/100;
	a[3]=(n-a[0]*10000-a[1]*1000-a[2]*100)/10;
	a[4]=(n-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10);
	for(i=0;i<8;i++){
		for(j=0;j<5;j++){
			cout<<a0[a[j]][i];
		}
		cout<<endl;
	}
	f=true;
	cin>>n;
	}
	return 0;
}