<image>


At the request of a friend who started learning abacus, you decided to create a program to display the abacus beads. Create a program that takes a certain number as input and outputs a row of abacus beads. However, the number of digits of the abacus to be displayed is 5 digits, and the arrangement of beads from 0 to 9 is as follows using'*' (half-width asterisk),''(half-width blank), and'=' (half-width equal). It shall be expressed as.

<image>



Input

Multiple test cases are given. Up to 5 digits (integer) are given on one line for each test case.

The number of test cases does not exceed 1024.

Output

Output the abacus bead arrangement for each test case. Insert a blank line between the test cases.

Example

Input

2006
1111


Output

****
    *
=====
 *  *
****
* ***
*****
*****

*****

=====
 ****
*
*****
*****
*****

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
f = 0
while 1:
	try:
		n = int(input())
	except:
		break
	if f:
		print()
	f = 1
	a = [['*' for _ in range(5)] for _ in range(8)]
	for i in range(4, -1, -1):
		b = n % 10
		a[not b // 5][i] = ' '
		a[b % 5 + 3][i] = ' '
		n //= 10
	a[2] = '=' * 5
	for i in a:
		print(''.join(i), end='')
		print()


f = 0
while 1:
	try:
		n = int(input())
	except:
		break
	if f:
		print()
	f = 1
	a = [[0 for _ in range(5)] for _ in range(8)]
	for i in range(4, -1, -1):
		b = n % 10
		a[not b // 5][i] = 1
		a[b % 5 + 3][i] = 1
		n //= 10
	for i in range(8):
		for j in range(5):
			if i == 2:
				print('=', end='')
			else:
				print(' ' if a[i][j] else '*', end='')
		print()


import sys
isnewLine = False
pattern = {'0': '* = ****', '1': '* =* ***', '2': '* =** **', '3': '* =*** *', '4': '* =**** ', '5': ' *= ****', '6': ' *=* ***', '7': ' *=** **', '8': ' *=*** *', '9': ' *=**** '}
for line in sys.stdin:
	if isnewLine:
		print()
	else:
		isnewLine = True
	line = line[:-1]
	line = '0' * (5 - len(line)) + line
	bar = [pattern[item] for item in line]
	for (i1, i2, i3, i4, i5) in zip(bar[0], bar[1], bar[2], bar[3], bar[4]):
		print(i1 + i2 + i3 + i4 + i5)


f = 0
while 1:
	try:
		n = int(input())
	except:
		break
	if f:
		print()
	f = 1
	a = [['*' for _ in range(5)] for _ in range(8)]
	for i in range(4, -1, -1):
		b = n % 10
		a[not b // 5][i] = ' '
		a[b % 5 + 3][i] = ' '
		n //= 10
	a[2] = '=' * 5
	for i in a:
		print(''.join(i))


def get_input():
	while True:
		try:
			yield ''.join(input())
		except EOFError:
			break
table = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ', ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
N = list(get_input())
for l in range(len(N)):
	if l > 0:
		print('')
	num = int(N[l])
	ans = []
	for i in range(5):
		ans.append(table[num // 10 ** (4 - i)])
		num = num % 10 ** (4 - i)
	for i in range(8):
		for j in range(5):
			print(ans[j][i], end='')
		print('')


abacus = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ', ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
first = False
while 1:
	try:
		n = input()
	except EOFError:
		break
	if first:
		print()
	else:
		first = True
	n = n.zfill(5)
	nlist = list(n)
	ans = []
	for n in nlist:
		ans.append(list(abacus[int(n)]))
	ans_t = [list(x) for x in zip(*ans)]
	for i in range(8):
		print(''.join((a for a in ans_t[i])))


f = 0
while 1:
	try:
		n = int(input())
	except:
		break
	if f:
		print()
	f = 1
	a = [[0 for _ in range(5)] for _ in range(8)]
	for i in range(4, -1, -1):
		b = n % 10
		if b >= 5:
			a[0][i] = 1
		else:
			a[1][i] = 1
		a[b % 5 + 3][i] = 1
		n //= 10
	for i in range(8):
		for j in range(5):
			if i == 2:
				print('=', end='')
			else:
				print(' ' if a[i][j] else '*', end='')
		print()


abacus = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ', ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
flag = 0
while 1:
	try:
		N = input()
	except:
		break
	if flag:
		print()
	else:
		flag = 1
	N = list(N.zfill(5))
	answer = []
	for i in N:
		answer.append(list(abacus[int(i)]))
	answer = [list(x) for x in zip(*answer)]
	for i in range(8):
		print(''.join(answer[i]))


L = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ', ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
c = 0
while True:
	try:
		num = int(input())
	except EOFError:
		break
	if c > 0:
		print()
	c += 1
	str = '{:05}'.format(num)
	s = [int(x) for x in list(str)]
	for i in range(len(L[0])):
		t = []
		for j in range(len(s)):
			t.append(L[s[j]][i])
		print(''.join(t))


dic = {'0': '* = ****', '1': '* =* ***', '2': '* =** **', '3': '* =*** *', '4': '* =**** ', '5': ' *= ****', '6': ' *=* ***', '7': ' *=** **', '8': ' *=*** *', '9': ' *=**** '}

def trans(lst):
	ylen = len(lst)
	xlen = len(lst[0])
	ret = [[None] * ylen for _ in range(xlen)]
	for y in range(ylen):
		for x in range(xlen):
			ret[x][y] = lst[y][x]
	return ret

def print_abac(num):
	num = num.zfill(5)
	lst = [dic[c] for c in num]
	lst = trans(lst)
	for line in lst:
		print(''.join(line))
cnt = 0
while True:
	try:
		num = input()
		if cnt != 0:
			print()
		else:
			cnt += 1
		print_abac(num)
	except EOFError:
		break


abacus = [['*', '*', '*', '*', '*', ' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' ', '*', '*', '*', '*', '*'], ['=', '=', '=', '=', '=', '=', '=', '=', '=', '='], [' ', '*', '*', '*', '*', ' ', '*', '*', '*', '*'], ['*', ' ', '*', '*', '*', '*', ' ', '*', '*', '*'], ['*', '*', ' ', '*', '*', '*', '*', ' ', '*', '*'], ['*', '*', '*', ' ', '*', '*', '*', '*', ' ', '*'], ['*', '*', '*', '*', ' ', '*', '*', '*', '*', ' ']]
ans = [['' for c in range(5)] for r in range(8)]
first = True
while True:
	try:
		n = list(input())
	except:
		break
	for i in range(5 - len(n)):
		for r in range(8):
			ans[r][i] = abacus[r][0]
	for i in range(len(n)):
		for r in range(8):
			ans[r][5 - len(n) + i] = abacus[r][int(n[i])]
	if first:
		first = False
	else:
		print()
	for r in range(8):
		print(*ans[r], sep='')


import sys
from sys import stdin
input = stdin.readline

def conv_avacus(num_txt):
	abacus = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ', ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
	ans = [abacus[int(num_txt[4])], abacus[int(num_txt[3])], abacus[int(num_txt[2])], abacus[int(num_txt[1])], abacus[int(num_txt[0])]]
	return ans

def rotate_and_print(data):
	y_size = len(data)
	x_size = len(data[0])
	A = [[''] * y_size for _ in range(x_size)]
	for i in range(x_size):
		for j in range(y_size):
			A[i][j] = data[y_size - 1 - j][i]
	for l in A:
		print(''.join(l))

def main(args):
	first_case = True
	for line in sys.stdin:
		if not first_case:
			print()
		num_txt = line.strip().zfill(5)
		result = conv_avacus(num_txt)
		rotate_and_print(result)
		first_case = False
main(sys.argv[1:])


abcus = {'0': '* = ****', '1': '* =* ***', '2': '* =** **', '3': '* =*** *', '4': '* =**** ', '5': ' *= ****', '6': ' *=* ***', '7': ' *=** **', '8': ' *=*** *', '9': ' *=**** '}
num = [['' for i in range(5)] for j in range(8)]
cnt = 0
while True:
	try:
		a = input().zfill(5)
		if cnt != 0:
			print()
		for i in range(5):
			n = abcus[a[i]]
			for j in range(8):
				num[j][i] = n[j]
		for i in range(8):
			print(''.join(num[i]))
		cnt += 1
	except:
		break