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

int main() {
	string sa;
	while (cin >> sa) {
		int ca = 0;
		if (ca != 0)cout << endl;
		char so[5][8];
		int a = sa.size();

		for (int i = 0;i < 5;i++) {
			for (int j = 0;j < 8;j++) {
				if (j == 1 || j == 3)so[i][j] = ' ';
				else if (j == 2) { so[i][j] = '='; }
				else so[i][j] = '*';
			}
		}
	 reverse(sa.begin(), sa.end());
	 string s = sa;

		for (int i =4;i>=5-a;i--) {
			if(s[4-i]>='5'){
				so[i][0] = ' ';
				so[i][1] = '*';
			}
			else {
				so[i][0] = '*';
				so[i][1] = ' ';
			}

			if ((s[4-i] - '0') % 5 == 0) {
				so[i][3] = ' ';
				for (int ia = 4;ia <= 7;ia++)so[i][ia] = '*';
			}
			else if ((s[4-i] - '0') % 5 == 1) {
				for (int j = 3;j <= 7;j++) {
					if (j == 4)so[i][j] = ' ';
					else { so[i][j] = '*'; }
				}
			}
			else if ((s[4-i] - '0') % 5 == 2) {

				for (int j = 3;j <= 7;j++) {
					if (j == 5)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
			else if ((s[4-i] - '0') % 5 == 3) {
				for (int j = 3;j <= 7;j++) {
					if (j == 6)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
			else {
				for (int j = 3;j <= 7;j++) {
					if (j == 7)so[i][j] = ' ';
					else so[i][j] = '*';
				}
			}
		}
		for (int i = 0;i < 8;i++) {
			for (int j = 0;j < 5;j++) {
				cout << so[j][i];
				if (j == 4)cout << endl;
			}
		}
		ca++;
	}
	return 0;
}