#include <iostream>
#include <cstring>

const char PATTERN[10][9] = {
	"* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
	" *= ****", " *=* ***", " *=** **", " *=*** *", " *=**** "};

int main()
{
	std::string input;
	int loops = 0;
	while (getline(std::cin, input)) {
		int n = input.length();
		char abacus[5][9];
		
		for (int i=0; i<5-n; i++) strcpy(abacus[i], PATTERN[0]);
		for (int i=0; i<n; i++) {
			int d = input[i] - '0';
			strcpy(abacus[i+5-n], PATTERN[d]);
		}
		if (loops>0) std::cout << std::endl;
		
		for (int j=0; j<8; j++) {
			for (int i=0; i<5; i++) {
				std::cout << abacus[i][j];
			}
			std::cout << std::endl;
		}
		
		loops++;
	}
	return 0;
}


