import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    string n = readln();
    while(true){
	char[5][8] s;
	for(int i=0;i<5;i++){
	    s[0][i] = '*';
	    s[1][i] = ' ';
	    s[2][i] = '=';
	    s[3][i] = ' ';
	    s[4][i] = '*';
	    s[5][i] = '*';
	    s[6][i] = '*';
	    s[7][i] = '*';
	}
	n =  n.chomp();
	int si = to!int(n.length);
	for(int i=si-1;i>=0;i--){
	    int m = to!int(n[i]-'0');
	    if(m >= 5){
		s[0][5-si+i] = ' ';
		s[1][5-si+i] = '*';
		m -= 5;
	    }
	    s[3][5-si+i] = '*';
	    s[4][5-si+i] = '*';
	    s[5][5-si+i] = '*';
	    s[6][5-si+i] = '*';
	    s[7][5-si+i] = '*';
	    s[3+m][5-si+i] = ' ';
	}
	foreach(i;s){
	    foreach(j;i) write(j);
	    writeln();
	}
	n = readln();
	if(stdin.eof()) break;
	writeln();

    }


}