#include <iostream>
#include <string>


std::string to_soroban(const int &n, const int &level = -1) {
	if (level == 5) {
		return "";
	}
	else if (level == -1) {
		auto rest = to_soroban(n, level + 1);
		std::string upper = "\n";
		std::string lower = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 10 > 4) {
				upper = " " + upper;
				lower = "*" + lower;
			}
			else {
				upper = "*" + upper;
				lower = " " + lower;
			}
			copy /= 10;
		}
		return upper + lower + "=====\n" + rest;
	}
	else {
		auto rest = to_soroban(n, level + 1);
		std::string res = "\n";
		int copy = n;
		for (auto i = 0; i < 5; ++i) {
			if (copy % 5 == level) {
				res = " " + res;
			}
			else {
				res = "*" + res;
			}
			copy /= 10;
		}
		return res + rest;
	}
}
int main() {
	int j;
	std::cin >> j;
	std::cout << to_soroban(j);
	for (int i; std::cin >> i;) {
		std::cout << '\n' << to_soroban(i);
	}
	return 0;
}