# Baekjoon-2290-LCD Test

s,n = map(int, input().split())

num_dict = {k: [[' '] * (s+2) for _ in range(2*s+3)] for k in range(10)}

def make_nums(arr, idxs):
for idx in idxs:
for i in range(s):
if idx==1:
arr[i+1] = '-'
if idx==2:
arr[i+1] = '|'
if idx==3:
arr[s+1][i+1] = '-'
if idx==4:
arr[i+1][-1] = '|'
if idx==5:
arr[s+1+i+1] = '|'
if idx==6:
arr[2*s+2][i+1] = '-'
if idx==7:
arr[s+1+i+1][-1] = '|'

return arr

num_dict = make_nums(num_dict,[1,2,5,6,7,4])
num_dict = make_nums(num_dict, [4,7])
num_dict = make_nums(num_dict,[1,4,3,5,6])
num_dict = make_nums(num_dict,[1,4,3,7,6])
num_dict = make_nums(num_dict,[2,3,4,7])
num_dict = make_nums(num_dict,[1,2,3,7,6])
num_dict = make_nums(num_dict,[1,2,3,5,6,7])
num_dict = make_nums(num_dict,[1,4,7])
num_dict = make_nums(num_dict,[1,2,3,4,5,6,7])
num_dict = make_nums(num_dict,[1,2,3,4,6,7])

n = "%d"%n
result = [[] for _ in range(2*s+3)]
for i in range(2*s+3):
for j,c in enumerate(n):
result[i] += num_dict[int(c)][i]
if j != len(n)-1:
result[i] += [' ']

for r in result:
print(*r, sep='')