#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;
string abacus[10] = {"* = ****", 
					 "* =* ***",
					 "* =** **",
					 "* =*** *",
					 "* =**** ",
					 " *= ****",
					 " *=* ***",
					 " *=** **",
					 " *=*** *",
					 " *=**** "};

void solve()
{
	bool init_flag = true;
	int num;
	while(cin >> num)
	{
		if(init_flag)
		{
			init_flag = false;
		}
		else
		{
			cout << endl;
		}
		vector<int> a(5);
		for(int i = 0; i < 5; ++i)
		{
			a[i] = num % 10;
			num /= 10;
		}
		reverse(a.begin(), a.end());
		for(int i = 0; i < 8; ++i)
		{
			for(int j = 0; j < 5; ++j)
			{
				cout << abacus[a[j]][i];
			}
			cout << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}