#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>


#ifdef _DEBUG
#define typeof(X) std::identity<decltype(X)>::type //C++0x (for vs2010)
#else
#define typeof(X) __typeof__(X) // for gcc
#endif

#define sz(a)  int((a).size())
#define FOREACH(it, c) for (typeof((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define FOR(i,count) for (int i = 0; i < (int)(count); i++)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
const int MODULO = 100000 ;
const int INF = 100000000; //1e8

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef complex<double> Cd;

using namespace std;


int main()
{
	int n;
	bool nw = false;
	while(cin>>n){
		if(nw) puts("");
		nw = true;
		int a[5];
		for(int i = 10000,j = 0; j < 5; i /= 10,j++) a[j] = (n / i) % 10;
		char c[6];
		FOR(j,5) c[j] = a[j]/5 ? ' ':'*';
		c[5] = '\0';
		puts(c);
		FOR(j,5) c[j] = a[j]/5 ? '*':' ';
		puts(c);
		puts("=====");
		FOR(i,5){
			FOR(j,5){
				putchar(a[j]%5 == i ? ' ':'*');
			}
			puts("");
		}
	}
	return 0;
}