#include<string>
#include<iostream>
using namespace std;
int main() {
	string a;
	while (cin >> a) {
		int b[5], c[5],e[5];
		fill(b, b + 5, 0);
		fill(c, c + 5, 0);
		fill(e, e + 5, 4);
		for (int i = a.length() - 1; i >= 0; i--) {
			int d = (int)a[i] - '0';
			if (d >= 5) {
				b[5 - a.length() + i]++;
				d -= 5;
			}
			c[5 - a.length() + i] += d;
			e[5 - a.length() + i] -= d;
		}
		for (int i = 0; i < 5; i++) {
			if (b[i] != 0)
				cout << " ";
			else
				cout << "*";
		}
		cout << endl;
		for (int i = 0; i < 5; i++) {
			if (b[i] != 0)
				cout << "*";
			else
				cout << " ";
		}
		cout << endl;
		for (int i = 0; i < 5; i++)
			cout << "=";
		cout << endl;
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 5; j++) {
				if (c[j] != 0) {
					cout << "*";
					c[j]--;
				}
				else if (i >= 5 - e[j]) {
					cout << "*";
				}
				else
					cout << " ";
			}
			cout << endl;
		}
	}
}