You know that Japan is the country with almost the largest 'electronic devices per person' ratio. So you might be quite surprised to find out that the primary school in Japan teaches to count using a Soroban — an abacus developed in Japan. This phenomenon has its reasons, of course, but we are not going to speak about them. Let's have a look at the Soroban's construction. [Image] 

Soroban consists of some number of rods, each rod contains five beads. We will assume that the rods are horizontal lines. One bead on each rod (the leftmost one) is divided from the others by a bar (the reckoning bar). This single bead is called go-dama and four others are ichi-damas. Each rod is responsible for representing a single digit from 0 to 9. We can obtain the value of a digit by following simple algorithm:  Set the value of a digit equal to 0.  If the go-dama is shifted to the right, add 5.  Add the number of ichi-damas shifted to the left. 

Thus, the upper rod on the picture shows digit 0, the middle one shows digit 2 and the lower one shows 7. We will consider the top rod to represent the last decimal digit of a number, so the picture shows number 720.

Write the program that prints the way Soroban shows the given number n.


-----Input-----

The first line contains a single integer n (0 ≤ n < 10^9).


-----Output-----

Print the description of the decimal digits of number n from the last one to the first one (as mentioned on the picture in the statement), one per line. Print the beads as large English letters 'O', rod pieces as character '-' and the reckoning bar as '|'. Print as many rods, as many digits are in the decimal representation of number n without leading zeroes. We can assume that number 0 has no leading zeroes.


-----Examples-----
Input
2

Output
O-|OO-OO

Input
13

Output
O-|OOO-O
O-|O-OOO

Input
720

Output
O-|-OOOO
O-|OO-OO
-O|OO-OO

Difficulty: EASY

Solutions:
import sys
import math
n = sys.stdin.readline()
d = []
i = 0
while n[i] != '\n':
	v = int(n[i])
	t = ['-', '-', '|', 'O', 'O', 'O', 'O', 'O']
	if v > 4:
		t[1] = 'O'
		t[v - 2] = '-'
	else:
		t[0] = 'O'
		t[v + 3] = '-'
	d.append(t)
	i += 1
for j in range(i - 1, -1, -1):
	print(''.join(d[j]))


n = list(map(int, list(input())))
sob = []
sob.append('O-|-OOOO')
sob.append('O-|O-OOO')
sob.append('O-|OO-OO')
sob.append('O-|OOO-O')
sob.append('O-|OOOO-')
sob.append('-O|-OOOO')
sob.append('-O|O-OOO')
sob.append('-O|OO-OO')
sob.append('-O|OOO-O')
sob.append('-O|OOOO-')
n = n[::-1]
for k in n:
	print(sob[k])


s = input()
i = len(s) - 1
while i >= 0:
	r = int(s[i])
	if r == 0:
		print('O-|-OOOO')
	elif r == 1:
		print('O-|O-OOO')
	elif r == 2:
		print('O-|OO-OO')
	elif r == 3:
		print('O-|OOO-O')
	elif r == 4:
		print('O-|OOOO-')
	elif r == 5:
		print('-O|-OOOO')
	elif r == 6:
		print('-O|O-OOO')
	elif r == 7:
		print('-O|OO-OO')
	elif r == 8:
		print('-O|OOO-O')
	elif r == 9:
		print('-O|OOOO-')
	i = i - 1


a = reversed(input())
for j in a:
	j = int(j)
	if j < 5:
		print('O-|' + j * 'O' + '-' + (4 - j) * 'O')
	elif j == 5:
		print('-O|' + '-OOOO')
	elif j == 9:
		print('-O|' + 'OOOO-')
	else:
		print('-O|' + (j - 5) * 'O' + '-' + (4 - j + 5) * 'O')


x = input()
for item in reversed(x):
	n = int(item)
	if n > 5:
		ans = '-O|' + 'O' * (n - 5) + '-' + 'O' * (9 - n)
	elif n < 5:
		ans = 'O-|' + 'O' * n + '-' + 'O' * (4 - n)
	else:
		ans = '-O|-OOOO'
	print(ans)


t = input()
for i in range(len(t) - 1, -1, -1):
	if int(t[i]) < 5:
		print('O-|', end='')
		for j in range(4):
			if j == int(t[i]):
				print('-', end='')
				print('O', end='')
			else:
				print('O', end='')
		if t[i] == '4':
			print('-', end='')
	else:
		print('-O|', end='')
		count = int(t[i]) % 5
		for j in range(4):
			if j == count:
				print('-', end='')
				print('O', end='')
			else:
				print('O', end='')
		if count == 4:
			print('-', end='')
	print()


n = int(input())
if n == 0:
	print('O-|-OOOO')
else:
	while n > 0:
		d = n % 10
		n = n // 10
		print(('-O', 'O-')[d < 5] + '|', end='')
		d = d % 5
		print('O' * d + '-' + 'O' * (4 - d))


from sys import stdin, exit
n = int(stdin.readline().rstrip())
l = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
if n == 0:
	print(l[0])
	exit()
while n > 0:
	print(l[n % 10])
	n //= 10


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
from types import new_class
n = input()
for x in range(len(n) - 1, -1, -1):
	a = ord(n[x]) - ord('0')
	print(['O-', '-O'][a >= 5] + '|', end='')
	if a >= 5:
		a -= 5
	print('O' * a + '-' + 'O' * (4 - a))


a = 'OO|OOOOO'
s = input()
for c in reversed(s):
	c = int(c)
	x = list(a)
	if c >= 5:
		x[0] = '-'
	else:
		x[1] = '-'
	x[3 + c % 5] = '-'
	print(''.join(x))


s = int(input())
str1 = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
if s == 0:
	print(str1[0])
else:
	while s:
		print(str1[s % 10])
		s = s // 10


num = {'0': 'O-' + '|' + '-OOOO', '1': 'O-' + '|' + 'O-OOO', '2': 'O-' + '|' + 'OO-OO', '3': 'O-' + '|' + 'OOO-O', '4': 'O-' + '|' + 'OOOO-', '5': '-O' + '|' + '-OOOO', '6': '-O' + '|' + 'O-OOO', '7': '-O' + '|' + 'OO-OO', '8': '-O' + '|' + 'OOO-O', '9': '-O' + '|' + 'OOOO-'}
a = input()
for i in reversed(a):
	print(num[i])


n = input()
ans = []
for x in n[::-1]:
	a = 1 - int(x) // 5
	b = int(x) // 5
	c = int(x) % 5
	d = 4 - int(x) % 5
	string = '{a}-{b}|{c}-{d}'.format(a='O' * a, b='O' * b, c='O' * c, d='O' * d)
	print(string)


dic = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
n = input()[-1::-1]
for i in n:
	print(dic[int(i)])


n = input()
answer = ''
for i in n:
	o = int(i)
	if o >= 5:
		o -= 5
		answer += '-O|'
	else:
		answer += 'O-|'
	answer += o * 'O' + '-' + (4 - o) * 'O' + '*'
print(*answer[:len(answer) - 1].split('*')[::-1], sep='\n')


n = input()
soroban = ''
for i in range(len(n)):
	digit = int(n[len(n) - i - 1])
	soroban = ''
	if digit >= 5:
		soroban += '-O|'
		digit = digit - 5
	else:
		soroban += 'O-|'
	if digit == 0:
		soroban += '-OOOO'
	elif digit == 1:
		soroban += 'O-OOO'
	elif digit == 2:
		soroban += 'OO-OO'
	elif digit == 3:
		soroban += 'OOO-O'
	elif digit == 4:
		soroban += 'OOOO-'
	print(soroban)


n = input()
n = n[::-1]
a = 'O-|-OOOO'
j = 0
for i in n:
	b = list(a)
	if int(i) < 5:
		b[3 + int(i)] = a[3]
		if int(i) > 0:
			b[3] = a[0]
	else:
		j = int(i) - 5
		b[3 + j] = a[3]
		if j > 0:
			b[3] = a[0]
		b[0] = a[1]
		b[1] = a[0]
	str = ''
	print(str.join(b))


def enc(c):
	c = int(c)
	res = ''
	if c >= 5:
		res += '-O'
	else:
		res += 'O-'
	res += '|'
	res += 'O' * (c % 5)
	res += '-'
	res += 'O' * (4 - c % 5)
	return res
s = input()
ans = []
for c in s[::-1]:
	ans.append(enc(c))
print('\n'.join(ans))


n = input()
s = n[::-1]
for i in s:
	i = int(i)
	if i < 5:
		print('O-|' + 'O' * i + '-' + (4 - i) * 'O')
	else:
		print('-O|' + 'O' * (i - 5) + '-' + (9 - i) * 'O')


s = str(input())
s = s[::-1]
for i in s:
	ans = ''
	if int(i) < 5:
		ans = ans + 'O-|'
		i = int(i)
	else:
		ans = ans + '-O|'
		i = int(i) - 5
	ans = ans + i * 'O' + '-' + (4 - i) * 'O'
	print(ans)


n = list(input().strip())
n.reverse()
for x in n:
	x = int(x)
	if x < 5:
		print('O-|', end='')
		print('O' * x + '-' + 'O' * (4 - x))
	else:
		print('-O|', end='')
		x = x - 5
		print('O' * x + '-' + 'O' * (4 - x))


s = input()
for x in s[::-1]:
	n = int(x)
	cur = ''
	if n >= 5:
		cur += '-O|'
		n -= 5
	else:
		cur += 'O-|'
	cur += ''.join(['O' for j in range(n)]) + '-' + ''.join(['O' for j in range(4 - n)])
	print(cur)


n = int(input())
d = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
if n == 0:
	print(d[0])
else:
	while n > 0:
		print(d[n % 10])
		n = n // 10


def soroban(n):
	n = list(n)
	n = [int(x) for x in n]
	for i in reversed(n):
		if i < 5:
			count = 0
			print('O-|', end='')
			for j in range(i):
				print('O', end='')
				count = count + 1
			print('-', end='')
			k = 5 - (count + 1)
			while k > 0:
				print('O', end='')
				k = k - 1
		else:
			count = 0
			print('-O|', end='')
			for j in range(i - 5):
				print('O', end='')
				count = count + 1
			print('-', end='')
			k = 5 - (count + 1)
			while k > 0:
				print('O', end='')
				k = k - 1
		print()
n = input('')
soroban(n)


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

def p(m):
	ans = ''
	if m < 5:
		ans += 'O-|'
	else:
		ans += '-O|'
		m -= 5
	ans += 'O' * m + '-' + 'O' * (4 - m)
	print(ans)
if n == 0:
	p(0)
else:
	while n:
		p(n % 10)
		n //= 10


n = input()
for i in range(-1, -1 * len(n) - 1, -1):
	g = int(n[i])
	if g < 5:
		x = 'O-|'
	else:
		x = '-O|'
	if g % 5 == 1:
		x += 'O-OOO'
	elif g % 5 == 2:
		x += 'OO-OO'
	elif g % 5 == 3:
		x += 'OOO-O'
	elif g % 5 == 4:
		x += 'OOOO-'
	else:
		x += '-OOOO'
	print(x)


n = int(input())
if n == 0:
	print('O-|-OOOO')
else:
	while n > 0:
		a = n % 10
		if a >= 5:
			s = '-O|'
			a -= 5
		else:
			s = 'O-|'
		if a == 0:
			s += '-OOOO'
		elif a == 1:
			s += 'O-OOO'
		elif a == 2:
			s += 'OO-OO'
		elif a == 3:
			s += 'OOO-O'
		elif a == 4:
			s += 'OOOO-'
		print(s)
		n //= 10


n = int(input())
s = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
if n == 0:
	print(s[n])
while n > 0:
	digit = n % 10
	n = n // 10
	print(s[digit])


n = input()
for j in range(len(n) - 1, -1, -1):
	num = int(n[j])
	if num >= 5:
		print('-O|', end='')
		num = num - 5
	else:
		print('O-|', end='')
	for _ in range(num):
		print('O', end='')
	print('-', end='')
	for k in range(4 - num):
		print('O', end='')
	print('')


def printDigit(d):
	if d == '0':
		print('O-|-OOOO')
	elif d == '1':
		print('O-|O-OOO')
	elif d == '2':
		print('O-|OO-OO')
	elif d == '3':
		print('O-|OOO-O')
	elif d == '4':
		print('O-|OOOO-')
	elif d == '5':
		print('-O|-OOOO')
	elif d == '6':
		print('-O|O-OOO')
	elif d == '7':
		print('-O|OO-OO')
	elif d == '8':
		print('-O|OOO-O')
	elif d == '9':
		print('-O|OOOO-')
n = int(input())
n = str(n)
n = list(n)
n.reverse()
for d in n:
	printDigit(d)


n = int(input())
t = str(n)
t = t[::-1]
for i in t:
	i = int(i)
	j = ''
	if i >= 5:
		i -= 5
		j += '-O|' + i * 'O' + '-' + (4 - i) * 'O'
	else:
		j += 'O-|' + i * 'O' + '-' + (4 - i) * 'O'
	print(j)


n = input()[::-1]
for x in n:
	a = int(x)
	(p, q) = (a // 5, a % 5)
	print('%s-%s|%s-%s' % ('O' * ((p + 1) % 2), 'O' * p, 'O' * q, 'O' * (4 - q)))


l = list(map(int, input()))
l.reverse()
for i in l:
	ch = 'O-'
	if i // 5 == 1:
		ch = ch[::-1]
	ch += '|' + i % 5 * 'O' + '-' + (4 - i % 5) * 'O'
	print(ch)


p = {'1': 'O-|O-OOO', '0': 'O-|-OOOO', '3': 'O-|OOO-O', '2': 'O-|OO-OO', '5': '-O|-OOOO', '4': 'O-|OOOO-', '7': '-O|OO-OO', '6': '-O|O-OOO', '9': '-O|OOOO-', '8': '-O|OOO-O'}
print('\n'.join((p[i] for i in input()[::-1])))


n = int(input())
if n == 0:
	print('O-|-OOOO')
while n > 0:
	p = n % 10
	if p >= 5:
		print('-O|', 'O' * (p - 5), '-', 'O' * (4 - (p - 5)), sep='')
	else:
		print('O-|', 'O' * p, '-', 'O' * (4 - p), sep='')
	n = int(n / 10)


t = 1
for _ in range(t):
	n = int(input())
	l = []
	if n == 0:
		l.append(0)
	while n:
		r = n % 10
		l.append(r)
		n //= 10
	ans = []
	for i in range(len(l)):
		s = ['O', '-', '|', '-', 'O', 'O', 'O', 'O']
		if l[i] >= 5:
			(s[0], s[1]) = (s[1], s[0])
			l[i] -= 5
			mark = 3
			while l[i]:
				(s[mark], s[mark + 1]) = (s[mark + 1], s[mark])
				l[i] -= 1
				mark += 1
			ans.append(s)
		else:
			mark = 3
			while l[i]:
				(s[mark], s[mark + 1]) = (s[mark + 1], s[mark])
				l[i] -= 1
				mark += 1
			ans.append(s)
	for i in range(len(ans)):
		for j in range(len(ans[i])):
			print(ans[i][j], end='')
		print()


r = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
n = input()
n = str(n)
for d in reversed(n):
	d = int(d)
	print(r[d])


def number(x):
	if x == 0:
		s = 'O-|-OOOO'
	if x == 1:
		s = 'O-|O-OOO'
	if x == 2:
		s = 'O-|OO-OO'
	if x == 3:
		s = 'O-|OOO-O'
	if x == 4:
		s = 'O-|OOOO-'
	if x == 5:
		s = '-O|-OOOO'
	if x == 6:
		s = '-O|O-OOO'
	if x == 7:
		s = '-O|OO-OO'
	if x == 8:
		s = '-O|OOO-O'
	if x == 9:
		s = '-O|OOOO-'
	return s
n = input()
ans = []
for i in n:
	ans.append(number(int(i)))
ans = ans[::-1]
for i in ans:
	print(i)


s = input()
s = s[::-1]
for ch in s:
	if ch == '0':
		print('O-|-OOOO')
	elif ch == '1':
		print('O-|O-OOO')
	elif ch == '2':
		print('O-|OO-OO')
	elif ch == '3':
		print('O-|OOO-O')
	elif ch == '4':
		print('O-|OOOO-')
	elif ch == '5':
		print('-O|-OOOO')
	elif ch == '6':
		print('-O|O-OOO')
	elif ch == '7':
		print('-O|OO-OO')
	elif ch == '8':
		print('-O|OOO-O')
	elif ch == '9':
		print('-O|OOOO-')


soroban = {}
right = ['-OOOO', 'O-OOO', 'OO-OO', 'OOO-O', 'OOOO-']
left = ['O-', '-O']
for i in range(0, 5):
	soroban[str(i)] = left[0] + '|' + right[i]
	soroban[str(i + 5)] = left[1] + '|' + right[i]
n = input()
rep = []
for i in n:
	rep.append(soroban[i])
rep.reverse()
for i in rep:
	print(i)


a = input()
for i in a[::-1]:
	if int(i) < 5:
		print('O-|' + 'O' * int(i) + '-' + (4 - int(i)) * 'O')
	else:
		print('-O|' + 'O' * (int(i) - 5) + '-' + (4 - (int(i) - 5)) * 'O')


l = list(str(input()))
l = reversed(l)
d = {}
for i in range(10):
	d[str(i)] = i
for i in l:
	i = d[i]
	a = ['O', '-']
	b = ['O', 'O', 'O', 'O']
	if i >= 5:
		b.insert(i - 5, '-')
		a = reversed(a)
	else:
		b.insert(i, '-')
	print(''.join(a) + '|' + ''.join(b))


import sys

def printDigitSoroban(digit):
	if digit == 0:
		print('O-|-OOOO')
	elif digit == 1:
		print('O-|O-OOO')
	elif digit == 2:
		print('O-|OO-OO')
	elif digit == 3:
		print('O-|OOO-O')
	elif digit == 4:
		print('O-|OOOO-')
	elif digit == 5:
		print('-O|-OOOO')
	elif digit == 6:
		print('-O|O-OOO')
	elif digit == 7:
		print('-O|OO-OO')
	elif digit == 8:
		print('-O|OOO-O')
	elif digit == 9:
		print('-O|OOOO-')

def convert(x):
	if x == 0:
		printDigitSoroban(0)
	while x >= 1:
		digit = x % 10
		printDigitSoroban(digit)
		x //= 10

def main():
	f = sys.stdin
	n = int(f.readline())
	convert(n)
main()


l = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
c = int(input())
if c == 0:
	print(l[0])
while c != 0:
	p = c % 10
	c //= 10
	print(l[p])


for i in input()[::-1]:
	if int(i) - 5 < 0:
		print('O-|', int(i) * 'O', '-', 'O' * (4 - int(i)), sep='')
	else:
		print('-O|', (int(i) - 5) * 'O', '-', 'O' * (4 - (int(i) - 5)), sep='')


import sys
input = sys.stdin.readline

def io():
	n = input()
	return n

def solve():
	n = io()
	n = n[::-1]
	figures = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
	for i in n:
		fig = figures.get(i)
		if fig == None:
			pass
		else:
			print(fig)
solve()


t = list(input())
g = t[::-1]
for v in g:
	a = int(v) // 5
	b = int(v) % 5
	if a == 0:
		if b == 4:
			h = 'O-|' + 'O' * b + '-'
			print(h)
		else:
			h = 'O-|' + 'O' * b + '-' + 'O' * (4 - b)
			print(h)
	elif b == 4:
		print('-O|' + 'O' * b + '-')
	else:
		print('-O|' + 'O' * b + '-' + 'O' * (4 - b))


l = ['-OOOO', 'O-OOO', 'OO-OO', 'OOO-O', 'OOOO-']
n = input()
for x in range(1, len(n) + 1):
	if int(n[-x]) < 5:
		print('O-|' + l[int(n[-x]) % 5])
	else:
		print('-O|' + l[int(n[-x]) % 5])


n = int(input())
tmp = n
ans = []
if n == 0:
	print('O-|-OOOO')
	quit()
while tmp:
	dig = tmp % 10
	tmp //= 10
	s = ''
	if dig >= 5:
		s = '-O|'
	else:
		s = 'O-|'
	if dig < 5:
		rem = int(dig)
	else:
		rem = int(dig - 5)
	s += 'O' * rem
	s += '-'
	s += 'O' * (4 - rem)
	ans.append(s)
for a in ans:
	print(a)


n = list(reversed(list(input())))
for c in n:
	x = int(c)
	if x >= 5:
		print('-O|', end='')
		print('O' * (x - 5) + '-' + 'O' * (9 - x))
	else:
		print('O-|' + 'O' * x + '-' + 'O' * (4 - x))


for c in map(int, str(int(input()))[::-1]):
	x = list('--|OOOOO')
	x[c // 5] = 'O'
	x[3 + c % 5] = '-'
	print(''.join(x))


d = {}
n = input()[::-1]
for i in range(10):
	if i < 5:
		d[i] = 'O-|' + 'O' * i + '-' + 'O' * (4 - i)
	else:
		d[i] = '-O|' + 'O' * (i - 5) + '-' + 'O' * (9 - i)
for i in n:
	print(d[int(i)])


n = int(input())
j = len(str(n))
i = 0
while i < j:
	a = n % 10
	n = n // 10
	if a >= 5:
		print('-O|' + 'O' * (a - 5) + '-' + 'O' * (9 - a))
	else:
		print('O-|' + 'O' * a + '-' + 'O' * (4 - a))
	i += 1


m = {}
m[0] = 'O-|-OOOO'
m[1] = 'O-|O-OOO'
m[2] = 'O-|OO-OO'
m[3] = 'O-|OOO-O'
m[4] = 'O-|OOOO-'
m[5] = '-O|-OOOO'
m[6] = '-O|O-OOO'
m[7] = '-O|OO-OO'
m[8] = '-O|OOO-O'
m[9] = '-O|OOOO-'
n = int(input())
while 1:
	print(m[n % 10])
	n //= 10
	if not n:
		break


k = input()
l = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
for i in k[::-1]:
	print(l[int(i)])


import sys
input = sys.stdin.readline

def gint():
	return int(input())

def gint_arr():
	return list(map(int, input().split()))

def gfloat():
	return float(input())

def gfloat_arr():
	return list(map(float, input().split()))

def pair_int():
	return map(int, input().split())
INF = 1 << 31
MOD = '1000000007'
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
n = gint()
m = {0: '|-OOOO', 1: '|O-OOO', 2: '|OO-OO', 3: '|OOO-O', 4: '|OOOO-'}
if not n:
	print('O-|-OOOO')
while n:
	print('-O' if n % 10 >= 5 else 'O-', end='')
	print(m[n % 5])
	n //= 10


a = input()
for i in a[::-1]:
	s = ''
	if int(i) >= 5:
		s += '-O|'
		k = int(i) - 5
		for j in range(k):
			s += 'O'
		s += '-'
		for j in range(9 - int(i)):
			s += 'O'
	else:
		s += 'O-|'
		for j in range(int(i)):
			s += 'O'
		s += '-'
		for j in range(4 - int(i)):
			s += 'O'
	print(s)


n = input()
n = n[::-1]
for item in n:
	item = int(item)
	if item >= 5:
		left = '-O'
	else:
		left = 'O-'
	item %= 5
	right = 'O' * item + '-' + 'O' * (4 - item)
	print(left + '|' + right)


s = input()
s = s[::-1]
lt = []
for i in s:
	soro = 'OO|OOOOO'
	soro = list(soro)
	i = int(i)
	if i >= 5:
		soro[0] = '-'
	else:
		soro[1] = '-'
	i = i % 5
	soro[3 + i] = '-'
	lt.append(''.join(soro))
for p in lt:
	print(*p, sep='')


ns = input()
for i in range(len(ns) - 1, -1, -1):
	if int(ns[i]) < 5:
		print('O-|', end='')
	else:
		print('-O|', end='')
	c = int(ns[i]) % 5
	for j in range(5):
		if j == c:
			print('-', end='')
		else:
			print('O', end='')
	print()


def print_digit(n):
	if n < 5:
		print('O-|' + 'O' * n + '-' + 'O' * (4 - n))
	else:
		n -= 5
		print('-O|' + 'O' * n + '-' + 'O' * (4 - n))
for i in input()[::-1]:
	print_digit(int(i))


angka = int(input())
if angka == 0:
	print('O-|-OOOO')
while angka > 0:
	digit_terakhir = angka % 10
	if digit_terakhir >= 5:
		print('-O|', end='')
		digit_terakhir -= 5
	else:
		print('O-|', end='')
	for i in range(digit_terakhir):
		print('O', end='')
	print('-', end='')
	for i in range(4 - digit_terakhir):
		print('O', end='')
	print('')
	angka //= 10


n3 = int(input())
if n3 == 0:
	print('O-|-OOOO')
else:
	while n3 != 0:
		n1 = n3 % 10
		n3 = n3 // 10
		s1 = ''
		if n1 < 5:
			s1 = 'O-'
		else:
			s1 = '-O'
			n1 = n1 - 5
		n2 = n1
		s1 = s1 + '|'
		while n1 != 0:
			s1 = s1 + 'O'
			n1 -= 1
		s1 += '-'
		while 4 - n2 != 0:
			s1 = s1 + 'O'
			n2 += 1
		print(s1)


n = input()
l = []
for i in range(len(n) - 1, -1, -1):
	b = int(n[i])
	s = ''
	a = 0
	if b < 5:
		a = a + b
	else:
		a = b - 5
	if b >= 5:
		s = s + '-O|'
	else:
		s = s + 'O-|'
	if a >= 1:
		for j in range(a):
			s = s + 'O'
	c = 8 - len(s)
	for j in range(0, c):
		if j == 0:
			s = s + '-'
		else:
			s = s + 'O'
	print(s)


def main():
	display = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
	n = input().lstrip('0')
	n = n if len(n) > 0 else '0'
	for c in n[::-1]:
		print(display[c])
main()


n = int(input())
r = 0
if n == 0:
	print('O-|-OOOO')
while n:
	r = n % 10
	if r >= 5:
		print('-O|', end='')
	else:
		print('O-|', end='')
	if r == 0 or r == 5:
		print('-OOOO')
	elif r == 1 or r == 6:
		print('O-OOO')
	elif r == 2 or r == 7:
		print('OO-OO')
	elif r == 3 or r == 8:
		print('OOO-O')
	elif r == 4 or r == 9:
		print('OOOO-')
	n = n // 10


s = str(int(input()))
for i in range(len(s) - 1, -1, -1):
	snew = ''
	x = int(s[i])
	if x >= 5:
		snew += '-O|'
	else:
		snew += 'O-|'
	snew += 'O' * (x % 5)
	snew += '-'
	snew += 'O' * (4 - x % 5)
	print(snew)


n = int(input())

def create(i):
	if i >= 5:
		print('-O' + '|' + 'O' * (i - 5) + '-' + 'O' * (4 - (i - 5)))
	else:
		print('O-' + '|' + 'O' * i + '-' + 'O' * (4 - i))
n = str(n)[::-1]
for i in str(n):
	create(int(i))


l = list(map(int, input()))
for i in range(len(l) - 1, -1, -1):
	if l[i] >= 5:
		print('-O|' + 'O' * (l[i] - 5) + '-' + 'O' * (4 - (l[i] - 5)))
	else:
		print('O-|' + 'O' * l[i] + '-' + 'O' * (4 - l[i]))


def l(d):
	val = 'O-|' if d < 5 else '-O|'
	val += 'O' * (d % 5) + '-' + 'O' * (4 - d % 5)
	return val
n = int(input())
if n == 0:
	print(l(0))
while n > 0:
	print(l(n % 10))
	n //= 10


n = int(input())
if n == 0:
	print('O-|-OOOO')
	exit()
while n != 0:
	l = ['-', '-', '|', 'O', 'O', 'O', 'O', 'O']
	n1 = n % 10
	n //= 10
	if n1 == 0:
		print('O-|-OOOO')
	elif n1 > 4:
		l[1] = 'O'
		l[n1 - 5 + 3] = '-'
		print(*l, sep='')
	elif n1 < 5:
		l[0] = 'O'
		l[n1 + 3] = '-'
		print(*l, sep='')


n = input()
t1 = len(n)

def fn(d):
	if d == 0:
		return 'O-|-OOOO'
	elif d == 1:
		return 'O-|O-OOO'
	elif d == 2:
		return 'O-|OO-OO'
	elif d == 3:
		return 'O-|OOO-O'
	elif d == 4:
		return 'O-|OOOO-'
	elif d == 5:
		return '-O|-OOOO'
	elif d == 6:
		return '-O|O-OOO'
	elif d == 7:
		return '-O|OO-OO'
	elif d == 8:
		return '-O|OOO-O'
	elif d == 9:
		return '-O|OOOO-'
n = n[::-1]
for i in n:
	print(fn(int(i)))


soroban = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
digits = list(input())
for i in range(len(digits) - 1, -1, -1):
	print(soroban[digits[i]])


n = input()
a = []
for i in n:
	b = ['O', 'O', '|', 'O', 'O', 'O', 'O', 'O']
	if int(i) >= 5:
		b[0] = '-'
		i = int(i)
		i -= 5
	else:
		b[1] = '-'
	b[3 + int(i)] = '-'
	a.append(b)
a.reverse()
for i in a:
	for j in i:
		print(j, end='')
	print()


def soroban(n_int: int) -> None:
	quotient = n_int // 10
	reminder = n_int % 10
	while quotient != 0:
		if reminder < 5:
			print('O-|' + 'O' * reminder + '-' + 'O' * (4 - reminder))
		else:
			reminder -= 5
			print('-O|' + 'O' * reminder + '-' + 'O' * (4 - reminder))
		n_int = n_int // 10
		quotient = n_int // 10
		reminder = n_int % 10
	if reminder < 5:
		print('O-|' + 'O' * reminder + '-' + 'O' * (4 - reminder))
	else:
		reminder -= 5
		print('-O|' + 'O' * reminder + '-' + 'O' * (4 - reminder))
n = int(input())
soroban(n)


n = input()
b = []
for i in range(len(n)):
	a = []
	if int(n[i]) < 5:
		a.append('O-|')
	else:
		a.append('-O|')
	if int(n[i]) % 5 == 0:
		a.append('-OOOO')
	elif int(n[i]) % 5 == 1:
		a.append('O-OOO')
	elif int(n[i]) % 5 == 2:
		a.append('OO-OO')
	elif int(n[i]) % 5 == 3:
		a.append('OOO-O')
	elif int(n[i]) % 5 == 4:
		a.append('OOOO-')
	b.append(str(''.join(a)))
b.reverse()
for i in range(len(n)):
	print(b[i])


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
ABCD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
months = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = input()
l = []
for i in n:
	if int(i) > 4:
		l.append('-O|' + 'O' * (int(i) - 5) + '-' + 'O' * (4 - int(i) + 5))
	else:
		l.append('O-|' + 'O' * int(i) + '-' + 'O' * (4 - int(i)))
for i in l[::-1]:
	print(i)


n = int(input())
arr = []
if n == 0:
	arr.append(0)
else:
	while n > 0:
		arr.append(n % 10)
		n = n // 10
for i in range(len(arr)):
	if arr[i] < 5:
		print('O-|', end='')
		for j in range(arr[i]):
			print('O', end='')
		print('-', end='')
		for j in range(4 - arr[i]):
			print('O', end='')
	if arr[i] == 5:
		print('-O|-OOOO', end='')
	if arr[i] > 5:
		print('-O|', end='')
		for j in range(arr[i] - 5):
			print('O', end='')
		print('-', end='')
		for j in range(9 - arr[i]):
			print('O', end='')
	if i != len(arr) - 1:
		print('')


n = input()
n = ''.join(reversed(n))
offset = 5
for i in range(len(n)):
	s = ''
	count = 4
	value = int(n[i])
	leading = value
	if value >= offset:
		s += '-O|'
		leading = value - offset
	else:
		s += 'O-|'
	for j in range(leading):
		s += 'O'
	if leading <= offset - 1:
		s += '-'
	for j in range(leading, offset - 1):
		s += 'O'
	print(s)


n = input()
n = n[::-1]
for d in n:
	if d == '0':
		print('O-|-OOOO')
	if d == '1':
		print('O-|O-OOO')
	if d == '2':
		print('O-|OO-OO')
	if d == '3':
		print('O-|OOO-O')
	if d == '4':
		print('O-|OOOO-')
	if d == '5':
		print('-O|-OOOO')
	if d == '6':
		print('-O|O-OOO')
	if d == '7':
		print('-O|OO-OO')
	if d == '8':
		print('-O|OOO-O')
	if d == '9':
		print('-O|OOOO-')


I = lambda : map(int, input().split())
res = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
n = input()
for i in n[::-1]:
	print(res[int(i)])


s = input('')
l = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
l1 = []
for i in range(len(s)):
	l1.append(l[int(s[i])])
l1 = l1[::-1]
print(*l1, sep='\n')


for d in reversed(input()):
	(x, y) = divmod(int(d), 5)
	A = list('OO|OOOOO')
	A[1 - x] = A[y - 5] = '-'
	print(*A, sep='')


digits = list(map(int, list(input())[::-1]))
for digit in digits:
	line = ''
	if digit < 5:
		line += 'O-|'
		for i in range(digit):
			line += 'O'
		line += '-'
		for i in range(4 - digit):
			line += 'O'
	else:
		line += '-O|'
		digit -= 5
		for i in range(digit):
			line += 'O'
		line += '-'
		for i in range(4 - digit):
			line += 'O'
	print(line)


s = input()
for i in range(len(s) - 1, -1, -1):
	x = int(s[i])
	ss = ''
	if x < 5:
		ss += 'O-|'
	else:
		ss += '-O|'
		x = x - 5
	if x == 0:
		ss += '-OOOO'
	elif x == 1:
		ss += 'O-OOO'
	elif x == 2:
		ss += 'OO-OO'
	elif x == 3:
		ss += 'OOO-O'
	elif x == 4:
		ss += 'OOOO-'
	print(ss)


arr = {}
arr['0'] = 'O-|-OOOO'
arr['1'] = 'O-|O-OOO'
arr['2'] = 'O-|OO-OO'
arr['3'] = 'O-|OOO-O'
arr['4'] = 'O-|OOOO-'
arr['5'] = '-O|-OOOO'
arr['6'] = '-O|O-OOO'
arr['7'] = '-O|OO-OO'
arr['8'] = '-O|OOO-O'
arr['9'] = '-O|OOOO-'
s = input()
s = s[::-1]
for i in s:
	print(arr[i])


d = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
print('\n'.join((d[ord(c) - ord('0')] for c in str(int(input()))[::-1])))


n = input()
a = n[::-1]
i = 0
while i < len(n):
	name = ''
	if int(a[i]) % 5 != 0 and int(a[i]) // 5 == 0:
		name += 'O' + '-' + '|' + int(a[i]) % 5 * 'O' + '-' + (4 - int(a[i]) % 5) * 'O'
	elif a[i] == '0':
		name += 'O' + '-' + '|' + '-' + 4 * 'O'
	elif int(a[i]) % 5 == 0:
		name += '-' + 'O' + '|' + '-' + 4 * 'O'
	elif int(a[i]) % 5 != 0 and int(a[i]) // 5 != 0:
		name += '-' + 'O' + '|' + int(a[i]) % 5 * 'O' + '-' + (4 - int(a[i]) % 5) * 'O'
	print(name)
	i += 1


s = str(input(''))
s = list(s)
l = []
for i in s:
	s = ''
	if int(i) > 5:
		s = s + '-O|'
		j = int(i) - 5
		s = s + 'O' * j + '-' + 'O' * (4 - j)
	elif int(i) < 5:
		s = s + 'O-|'
		j = int(i)
		s = s + 'O' * j + '-' + 'O' * (4 - j)
	else:
		s = s + '-O|-OOOO'
	l.append(s)
l = l[::-1]
for i in l:
	print(i)


def main(n=input()):
	for (i, a) in enumerate(reversed(list(map(int, n)))):
		x = ''
		if a >= 5:
			x += '-O'
		else:
			x += 'O-'
		x += '|'
		y = 4
		for i in range(a % 5):
			x += 'O'
			y -= 1
		x += '-'
		for i in range(y):
			x += 'O'
		print(x)
main()


n = int(input())
r = ['', 'O-|-OOOO'][n < 1]
while n:
	t = n % 10
	r += ['O-', '-O'][t // 5] + '|'
	t = t % 5
	r += 'O' * t + '-' + 'O' * (4 - t) + '\n'
	n //= 10
print(r)


n = input()
n = n[::-1]
for i in range(len(n)):
	x = int(n[i])
	if x < 5:
		s = 'O-|'
		s += x * 'O' + '-' + (4 - x) * 'O'
	else:
		s = '-O|'
		x -= 5
		s += x * 'O' + '-' + (4 - x) * 'O'
	print(s)


x = input()
y = [str(d) for d in x]
dim = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
y.reverse()
for num in y:
	print(dim[num])


import sys

class MyReader:

	def __init__(self):
		filename = 'file.in'
		if self.isLocal():
			self.file = open(filename)
		self.str = ['']
		self.ind = 1

	def isLocal(self):
		return len(sys.argv) > 1 and sys.argv[1] == 'SCHULLZ'

	def nextString(self):
		if self.isLocal():
			return self.file.read()
		else:
			return input()

	def nextInt(self):
		return int(self.nextToken())

	def nextToken(self):
		if self.ind >= len(self.str):
			self.ind = 0
			self.str = self.nextString().split()
		self.ind += 1
		return self.str[self.ind - 1]

def Solve():
	n = -1
	try:
		n = rdr.nextInt()
	except Exception:
		return False
	if n == 0:
		print('O-|-OOOO')
	while n > 0:
		k = n % 10
		if k >= 5:
			sys.stdout.write('-O')
		else:
			sys.stdout.write('O-')
		sys.stdout.write('|')
		m = n % 5
		for i in range(0, m):
			sys.stdout.write('O')
		sys.stdout.write('-')
		for i in range(0, 5 - m - 1):
			sys.stdout.write('O')
		n = n // 10
		print('')
	return True
rdr = MyReader()
if not rdr.isLocal():
	Solve()
else:
	while Solve():
		print('')


n = input()
a = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
for i in range(len(n) - 1, -1, -1):
	print(a[int(n[i])])


y = ['O', '-', '|', 'O', 'O', 'O', 'O']
b = 0
z = list(map(int, input()))
for i in range(1, len(z) + 1):
	if z[i * -1] > 4:
		y[0] = '-'
		y[1] = 'O'
		b = z[i * -1] - 5
	else:
		b = z[i * -1]
	y.insert(b + 3, '-')
	print(''.join(y))
	y = ['O', '-', '|', 'O', 'O', 'O', 'O']


a = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
n = input()
ln = len(n)
num = int(n)
if num == 0:
	print(a[0])
while num > 0:
	print(a[num % 10])
	num //= 10


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
mydict = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
n = input()
for i in reversed(n):
	print(mydict[i])


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	n = read_int()

	def help(n):
		s = ''
		if n >= 5:
			s += '-O'
			n -= 5
		else:
			s += 'O-'
		s += '|'
		s += 'O' * n + '-' + 'O' * (4 - n)
		print(s)
	if n == 0:
		help(n)
		return
	while n:
		(n, r) = divmod(n, 10)
		help(r)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def fib_to_n(n):
	f = []
	(a, b) = (0, 1)
	while a <= n:
		f.append(a)
		(a, b) = (b, a + b)
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P

def is_lucky(n):
	return set(list(str(n))).issubset({'4', '7'})
main()


n = input()
for i in range(len(n) - 1, -1, -1):
	x = int(n[i])
	a = ''
	if x < 5:
		a += 'O-|'
	else:
		a += '-O|'
		x -= 5
	t = ''
	for j in range(x):
		t += 'O'
	a += t + '-' + 'O' * (4 - x)
	print(a)


S = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
N = int(input())
if N == 0:
	print(S[0])
else:
	while N > 0:
		print(S[N % 10])
		N //= 10


for i in reversed(input()):
	ii = int(i)
	if ii < 5:
		print('O-', end='')
	else:
		print('-O', end='')
		ii -= 5
	print('|' + 'O' * ii + '-' + 'O' * (4 - ii))


n = int(input())
ans = ''
godama = False
if n == 0:
	print('O-|-OOOO')
while n > 0:
	digit = n % 10
	if digit >= 5:
		godama = True
	digit %= 5
	ichidama = digit
	if godama == True:
		ans += '-O|'
	else:
		ans += 'O-|'
	for x in range(ichidama):
		ans += 'O'
	ans += '-'
	for y in range(4 - ichidama):
		ans += 'O'
	n = n // 10
	print(ans)
	ans = ''
	godama = False


n = int(input())
t1 = '-O|'
t2 = 'O-|'
if n == 0:
	print('O-|-OOOO')
else:
	while n > 0:
		r = n % 10
		if r == 0:
			print(t2 + '-OOOO')
		elif r == 5:
			print(t1 + '-OOOO')
		elif r < 5:
			s = 'O' * r + '-' + 'O' * (4 - r)
			print(t2 + s)
		elif r > 5:
			s = 'O' * (r - 5) + '-' + 'O' * (9 - r)
			print(t1 + s)
		n = n // 10


n = input()
for i in reversed(n):
	k = int(i)
	if k < 5:
		print('O-|' + 'OOOO'[:k] + '-' + 'OOOO'[:4 - k])
	else:
		k -= 5
		print('-O|' + 'OOOO'[:k] + '-' + 'OOOO'[:4 - k])


li = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
s = input()[::-1]
for i in s:
	print(li[int(i)])


N = input()
answer = []
for i in range(1, len(N) + 1):
	digit = int(N[-i])
	if digit < 5:
		tmp_ans = 'O-|' + 'O' * digit + '-' + 'O' * (4 - digit)
		answer.append(tmp_ans)
		continue
	elif digit >= 5:
		digit = digit - 5
		tmp_ans = '-O|' + 'O' * digit + '-' + 'O' * (4 - digit)
		answer.append(tmp_ans)
		continue
print('\n'.join(map(str, answer)))


import math
import sys, collections
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def is_subsequence(x, y):
	x = list(x)
	for letter in y:
		if x and x[0] == letter:
			x.pop(0)
	return not x

def sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, mt.ceil(mt.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	(ind, floor) = (-1, -1)
	while left <= right:
		mid = (left + right) // 2
		if x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			ind = mid
			left = mid + 1
	return ind

def check(st):
	n = len(st)
	digitSum = 0
	for i in range(0, n):
		digitSum = digitSum + int(st[i])
	return digitSum % 9 == 0

def isPowerOfTwo(n):
	if n == 0:
		return False
	while n != 1:
		if n % 2 != 0:
			return False
		n = n // 2
	return True

def kitte(n):
	c = 0
	while n != 0:
		n = n // 2
		c += 1
	return c
mod = 10 ** 9 + 7

def main():
	n = input()[::-1]
	l = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
	for i in n:
		print(l[int(i)])
main()


def readln():
	return tuple(map(int, input().split()))

def tostr(d):
	if d >= 5:
		return '-O|' + 'O' * (d % 5) + '-' + 'O' * (4 - d % 5)
	return 'O-|' + 'O' * d + '-' + 'O' * (4 - d)
(n,) = readln()
if n == 0:
	print('O-|-OOOO')
else:
	while n:
		print(tostr(n % 10))
		n //= 10


N = input()
for digit in N[::-1]:
	Os = int(digit) % 5
	if int(digit) >= 5:
		print('-O|' + Os * 'O' + '-' + (4 - Os) * 'O')
	else:
		print('O-|' + Os * 'O' + '-' + (4 - Os) * 'O')


def main():
	dict = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
	n = int(input())
	if n == 0:
		print(dict[0])
		return
	while n != 0:
		print(dict[n % 10])
		n = n // 10
main()


import sys

def main():
	n = sys.stdin.read().strip()
	out = []
	for i in map(int, n[::-1]):
		r = i - 5 if i > 4 else i
		s = ('O-', '-O')[i > 4] + '|' + 'O' * r + '-' + 'O' * (4 - r)
		out.append(s)
	return out
print(*main(), sep='\n')


S = input()
digit = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
for x in S[::-1]:
	print(digit[int(x)])


n = int(input())
while True:
	d = n % 10
	s = ''
	if d < 5:
		s = 'O-|'
	else:
		s = '-O|'
		d -= 5
	s += 'O' * d + '-' + 'O' * (4 - d)
	print(s)
	n //= 10
	if n == 0:
		break


__author__ = 'david9517'
n = input()

def makeDigit(d):
	output = ''
	if d < 5:
		output += 'O-|'
	elif d >= 5:
		output += '-O|'
		d -= 5
	for iter in range(0, 5):
		if iter == d:
			output += '-'
		else:
			output += 'O'
	return output

def makeSoroban(n):
	output = ''
	if len(n) == 0:
		return ''
	elif len(n) != 0:
		return makeSoroban(n[1:]) + '\n' + makeDigit(int(n[0]))
print(makeSoroban(n))


number = input()
number = number[::-1]
for i in number:
	n = int(i)
	d = abs(5 - n)
	if n >= 5:
		print('-O|' + 'O' * d + '-' + 'O' * (4 - d))
	else:
		print('O-|' + 'O' * n + '-' + 'O' * (4 - n))


t = input()
for i in range(1, len(t) + 1):
	if int(t[-i]) < 5:
		print('O-|' + 'O' * int(t[-i]) + '-' + 'O' * (4 - int(t[-i])))
	elif int(t[-i]) <= 9:
		print('-O|' + 'O' * (int(t[-i]) - 5) + '-' + 'O' * (9 - int(t[-i])))


X = list(''.join(reversed(input())))
for i in range(len(X)):
	X[i] = int(X[i])
	print('O-' if X[i] < 5 else '-O', end='|')
	print('O' * (X[i] - 5) if X[i] >= 5 else 'O' * X[i], end='-')
	print('O' * (4 - (X[i] - 5)) if X[i] >= 5 else 'O' * (4 - X[i]))


n = input()
i = len(n) - 1
while i >= 0:
	k = int(n[i])
	if k == 0:
		print('O-|-OOOO')
	elif k == 1:
		print('O-|O-OOO')
	elif k == 2:
		print('O-|OO-OO')
	elif k == 3:
		print('O-|OOO-O')
	elif k == 4:
		print('O-|OOOO-')
	elif k == 5:
		print('-O|-OOOO')
	elif k == 6:
		print('-O|O-OOO')
	elif k == 7:
		print('-O|OO-OO')
	elif k == 8:
		print('-O|OOO-O')
	elif k == 9:
		print('-O|OOOO-')
	i = i - 1


s = input()
l = len(s)
ans = []
for i in s:
	a = []
	n = eval(i)
	if n >= 5:
		a.append('-O')
		n -= 5
	else:
		a.append('O-')
	a.append('|')
	if n == 0:
		a.append('-OOOO')
		ans.append(''.join(a))
		continue
	for i in range(n):
		a.append('O')
	a.append('-')
	for i in range(4 - n):
		a.append('O')
	ans.append(''.join(a))
for i in range(l - 1, -1, -1):
	print(ans[i])


d = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
n = input()
l = list(n)
l.reverse()
for i in range(len(l)):
	print(d[l[i]])


def soroban(digit):
	if digit == 0:
		a = 'O-|-OOOO'
	elif digit == 1:
		a = 'O-|O-OOO'
	elif digit == 2:
		a = 'O-|OO-OO'
	elif digit == 3:
		a = 'O-|OOO-O'
	elif digit == 4:
		a = 'O-|OOOO-'
	elif digit == 5:
		a = '-O|-OOOO'
	elif digit == 6:
		a = '-O|O-OOO'
	elif digit == 7:
		a = '-O|OO-OO'
	elif digit == 8:
		a = '-O|OOO-O'
	elif digit == 9:
		a = '-O|OOOO-'
	print(a)
	return
n = int(input())
if n:
	while n:
		digit = n % 10
		n = n // 10
		soroban(digit)
else:
	soroban(0)


def single_integer():
	return int(input())

def multi_integer():
	return map(int, input().split())

def string():
	return input()

def multi_string():
	return input().split()
number = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
n = string()
for i in n[::-1]:
	print(number[i])


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
n = int(input())
if n == 0:
	print('O-|-OOOO')
else:
	while n > 0:
		digit = n % 10
		ans = ''
		if digit >= 5:
			ans += '-O|'
		else:
			ans += 'O-|'
		if digit >= 5:
			digit -= 5
		count = 0
		for i in range(digit):
			ans += 'O'
			count += 1
		ans += '-'
		while count < 4:
			ans += 'O'
			count += 1
		print(ans)
		n = n // 10


__author__ = 'Lipen'

def actions(n):
	s = ''
	for x in reversed(n):
		if x >= 5:
			q = '-O'
			w = 'O' * (x - 5) + '-' + 'O' * (9 - x)
		else:
			q = 'O-'
			w = 'O' * x + '-' + 'O' * (4 - x)
		s += q + '|' + w + '\n'
	return s[:-1]

def main():
	n = list(map(int, input()))
	print(actions(n))
main()


z = list(input())
z.reverse()
for i in z:
	s = ''
	if int(i) >= 5:
		s += '-o'
		s += '|'
		m = int(i) - 5
		if m == 4:
			s += 'oooo-'
		else:
			for o in range(m):
				s += 'o'
			s += '-'
			for o in range(4 - m):
				s += 'o'
		print(s.upper())
	else:
		m = 4 - int(i)
		s += 'o-'
		s += '|'
		if i == 4:
			s += 'oooo-'
		else:
			for o in range(int(i)):
				s += 'o'
			s += '-'
			for o in range(m):
				s += 'o'
		print(s.upper())


n = int(input())
while 1:
	x = n % 10
	print(['O-', '-O'][x > 4] + '|' + x % 5 * 'O' + '-' + (4 - x % 5) * 'O')
	n //= 10
	if n < 1:
		break


n = input()
n = n[::-1]
a = []
a.append('O-|-OOOO')
a.append('O-|O-OOO')
a.append('O-|OO-OO')
a.append('O-|OOO-O')
a.append('O-|OOOO-')
a.append('-O|-OOOO')
a.append('-O|O-OOO')
a.append('-O|OO-OO')
a.append('-O|OOO-O')
a.append('-O|OOOO-')
for i in n:
	print(a[int(i)])


(n, beg, end, s) = (int(input()), 0, 0, '')
if n == 0:
	exit(print('O-|-OOOO'))
while n != 0:
	dig = n % 10
	if dig >= 5:
		(s, beg) = ('-O|', dig - 5)
		end = 4 - beg
	else:
		(s, beg) = ('O-|', dig)
		end = 4 - beg
	print(s + beg * 'O' + '-' + end * 'O')
	n //= 10


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

def llinp():
	return list(map(int, input().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
n = int(input())
s = str(n)
s = s[::-1]
for c in s:
	ans = ''
	if int(c) >= 5:
		ans += '-O|'
	else:
		ans += 'O-|'
	for i in range(int(c) % 5):
		ans += 'O'
	ans += '-'
	for i in range(4 - int(c) % 5):
		ans += 'O'
	print(ans)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = list(str(I()))
	while n:
		x = int(n.pop())
		if x == 0:
			print('O-|-OOOO')
		elif x == 1:
			print('O-|O-OOO')
		elif x == 2:
			print('O-|OO-OO')
		elif x == 3:
			print('O-|OOO-O')
		elif x == 4:
			print('O-|OOOO-')
		elif x == 5:
			print('-O|-OOOO')
		elif x == 6:
			print('-O|O-OOO')
		elif x == 7:
			print('-O|OO-OO')
		elif x == 8:
			print('-O|OOO-O')
		elif x == 9:
			print('-O|OOOO-')
main()


n = input()
l = len(n)
for i in range(l - 1, -1, -1):
	dig = int(n[i])
	if dig < 5:
		print('O-', end='')
	else:
		print('-O', end='')
	print('|', end='')
	extra = dig % 5
	bead_rem = 4 - extra
	print('O' * extra + '-' + 'O' * bead_rem)


n = int(input())
if n == 0:
	print('O-|-OOOO')
else:
	while n != 0:
		if n % 10 <= 4:
			print('O', end='-')
			print('|', end='')
			for i in range(n % 10):
				print('O', end='')
			print('-', end='')
			for i in range(4 - n % 10):
				print('O', end='')
		else:
			c = 0
			print('-', end='O')
			print('|', end='')
			for i in range(n % 10 - 5):
				print('O', end='')
				c += 1
			print('-', end='')
			for i in range(4 - c):
				print('O', end='')
		print()
		n = int(n / 10)


def solution():
	s = input()
	for i in range(len(s), 0, -1):
		i = i - 1
		res = ['O', 'O', '|', 'O', 'O', 'O', 'O', 'O']
		dig = int(s[i])
		if dig >= 5:
			res[0] = '-'
			dig = dig - 5
		else:
			res[1] = '-'
		res[dig + 3] = '-'
		print(''.join(res))
solution()


import math
n = input()
strings = ['O-|-OOOO' for i in range(len(n))]
for i in range(len(n)):
	first = ''
	if int(n[i]) >= 5:
		first = '-O|'
	else:
		first = 'O-|'
	second = ''
	if first == '-O|':
		left = max(0, int(n[i]) - 5)
		for z in range(left):
			second += 'O'
		if left != 5:
			second += '-'
			for z in range(5 - (left + 1)):
				second += 'O'
	else:
		for zzi in range(int(n[i])):
			second += 'O'
		second += '-'
		for zz in range(5 - (int(n[i]) + 1)):
			second += 'O'
	strings[i] = first + second
for i in list(reversed(strings)):
	print(i)


zero = 'O-|-OOOO'
one = 'O-|O-OOO'
two = 'O-|OO-OO'
three = 'O-|OOO-O'
four = 'O-|OOOO-'
five = '-O|-OOOO'
six = '-O|O-OOO'
seven = '-O|OO-OO'
eight = '-O|OOO-O'
nine = '-O|OOOO-'
l = list()
l.append(zero)
l.append(one)
l.append(two)
l.append(three)
l.append(four)
l.append(five)
l.append(six)
l.append(seven)
l.append(eight)
l.append(nine)
s = input()[::-1]
for i in s:
	print(l[int(i)])


answers = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
x = list(input())
x.reverse()
for i in x:
	print(answers[int(i)])


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
if n == 0:
	print('O-|-OOOO')
while n > 0:
	cur = n % 10
	n //= 10
	if cur >= 5:
		ans = '-O|'
	else:
		ans = 'O-|'
	cur = cur % 5
	ans += 'O' * cur + '-' + 'O' * (4 - cur)
	print(ans)


def func(n):
	if n < 5:
		print('O-|', end='')
		x = 'OOOO'
		x = x[0:n] + '-' + x[n:]
		print(x)
	else:
		print('-O|', end='')
		n = n - 5
		x = 'OOOO'
		x = x[0:n] + '-' + x[n:]
		print(x)
n = int(input())
func(n % 10)
n = n // 10
while n > 0:
	func(n % 10)
	n = n // 10


def makeNumbers(num):
	res = ''
	if num < 5:
		res += 'O-|'
		res += 'O' * num
		res += '-'
		res += 'O' * (4 - num)
	else:
		temp = num - 5
		res += '-O|'
		res += 'O' * temp
		res += '-'
		res += 'O' * (4 - temp)
	return res
n = int(input())
st = str(n)
len = len(st)
ans = ''
for i in range(len - 1, -1, -1):
	print(makeNumbers(int(st[i])))


import sys
from math import *
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
ls = lambda : list(input().strip())
from collections import defaultdict as df
import heapq
infinite = float('inf')
n = int(input())
l = len(str(n))
while l > 0:
	l -= 1
	temp = n % 10
	n //= 10
	if temp < 5:
		print('O-|', end='')
		for i in range(temp):
			print('O', end='')
		print('-', end='')
		for i in range(temp, 4):
			print('O', end='')
	else:
		print('-O|', end='')
		temp -= 5
		for i in range(temp):
			print('O', end='')
		print('-', end='')
		for i in range(temp, 4):
			print('O', end='')
	print()


n = input()
soroban = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
n = n[::-1]
for numero in n:
	print(soroban[int(numero)])


n = input()
n = n[::-1]
s = 'O-|-OOOO'

def less(p):
	print('O' * p + '-' + 'O' * (4 - p))
for i in range(len(n)):
	q = int(n[i])
	if q >= 5:
		print('-O|', end='')
		less(q - 5)
	elif q > 0 and q < 5:
		print('O-|', end='')
		less(q)
	else:
		print(s)


s = input()
res = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
for i in range(len(s) - 1, -1, -1):
	print(res[ord(s[i]) - ord('0')])


def convert(d):
	if d >= 5:
		return '-O|' + 'O' * (d - 5) + '-' + 'O' * (9 - d)
	else:
		return 'O-|' + 'O' * d + '-' + 'O' * (4 - d)
print('\n'.join(reversed(list(map(convert, list(map(int, input())))))))


n = int(input())

def numofdigits(n):
	ans = 0
	while n > 0:
		ans += 1
		n = n // 10
	return ans
rods = numofdigits(n)

def whattoprint(n):
	if n == 0:
		return 'O-|-OOOO'
	elif n == 1:
		return 'O-|O-OOO'
	elif n == 2:
		return 'O-|OO-OO'
	elif n == 3:
		return 'O-|OOO-O'
	elif n == 4:
		return 'O-|OOOO-'
	elif n == 5:
		return '-O|-OOOO'
	elif n == 6:
		return '-O|O-OOO'
	elif n == 7:
		return '-O|OO-OO'
	elif n == 8:
		return '-O|OOO-O'
	else:
		return '-O|OOOO-'
if n == 0:
	print('O-|-OOOO')
for i in range(rods):
	num = n % 10
	n = n // 10
	ans = whattoprint(num)
	print(ans)


import sys
import math
from sys import stdin, stdout

def sieve(N):
	primeNumbers = [True] * (N + 1)
	primeNumbers[0] = False
	primeNumbers[1] = False
	i = 2
	while i * i <= N:
		j = i
		if primeNumbers[j]:
			while j * i <= N:
				primeNumbers[j * i] = False
				j += 1
		i += 1
	return primeNumbers

def getPrime(N):
	primes = sieve(N)
	result = []
	for i in range(len(primes)):
		if primes[i]:
			result.append(i)
	return result

def factor(N):
	factors = []
	i = 1
	while i * i <= N:
		if N % i == 0:
			factors.append(i)
			if i != N // i:
				factors.append(N // i)
		i += 1
	return sorted(factors)

def reduceB(b):
	mod = 0
	for i in range(0, len(b)):
		mod = (mod * 10 + ord(b[i])) % 1000000007
	return mod

def gcd(a, b):
	if a < b:
		return gcd(b, a)
	if b == 0:
		return a
	return gcd(b, a % b)

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(input())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def main():
	n = int(input())
	while n >= 0:
		tmp = n % 10
		n = int(n / 10)
		s = ''
		count = 0
		if tmp >= 5:
			s += '-O|'
			tmp -= 5
		else:
			s += 'O-|'
		while tmp > 0:
			s += 'O'
			tmp -= 1
			count += 1
		ros = 8 - (3 + count)
		roDash = ros - (4 - count)
		for i in range(0, roDash):
			s += '-'
		roZero = 4 - count
		for i in range(0, roZero):
			s += 'O'
		print(s)
		if n == 0:
			break
main()


import os
import sys
from io import BytesIO, IOBase

def main():
	n = input()
	for x in n[::-1]:
		x = int(x)
		if x < 5:
			print('O-' + '|' + 'O' * x + '-' * 1 + 'O' * (4 - x))
		else:
			x -= 5
			print('-O' + '|' + 'O' * x + '-' * 1 + 'O' * (4 - x))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = input()
l = len(n)
for i in range(l - 1, -1, -1):
	a = int(n[i])
	x = ['O'] * 2
	y = ['O'] * 5
	if a < 5:
		x[1] = '-'
		y[a] = '-'
	else:
		x[0] = '-'
		y[a % 5] = '-'
	x = ''.join(x)
	y = ''.join(y)
	print(x + '|' + y)


def answer(n):
	if n == 0:
		print('O-|-OOOO')
	while n != 0:
		i = n % 10
		if i < 5:
			x = 4 - i
			print('O-|', end='')
			while i > 0:
				print('O', end='')
				i = i - 1
			print('-', end='')
			while x > 0:
				print('O', end='')
				x = x - 1
		else:
			print('-O|', end='')
			i = i - 5
			x = 4 - i
			while i > 0:
				print('O', end='')
				i = i - 1
			print('-', end='')
			while x > 0:
				print('O', end='')
				x = x - 1
		n = n // 10
		print('')
n = int(input())
answer(n)


n = int(input())
x = [int(x) for x in list(str(n))]
x = x[::-1]
for i in x:
	if i == 0:
		print('O-|-OOOO')
	elif i == 1:
		print('O-|O-OOO')
	elif i == 2:
		print('O-|OO-OO')
	elif i == 3:
		print('O-|OOO-O')
	elif i == 4:
		print('O-|OOOO-')
	elif i == 5:
		print('-O|-OOOO')
	elif i == 6:
		print('-O|O-OOO')
	elif i == 7:
		print('-O|OO-OO')
	elif i == 8:
		print('-O|OOO-O')
	elif i == 9:
		print('-O|OOOO-')


t = input()
i = 1
while i <= len(t):
	if int(t[-i]) < 5:
		print('O-|' + 'O' * int(t[-i]) + '-' + 'O' * (4 - int(t[-i])))
	elif int(t[-i]) <= 9:
		print('-O|' + 'O' * (int(t[-i]) - 5) + '-' + 'O' * (9 - int(t[-i])))
	i = i + 1


def main():
	n = input()
	out = []
	for c in n:
		dstr = ''
		digit = int(c)
		if digit < 5:
			dstr += 'O-|'
		else:
			dstr += '-O|'
			digit -= 5
		dstr += 'O' * digit + '-' + 'O' * (4 - digit)
		out.append(dstr)
	print('\n'.join(out[::-1]))
main()


a = int(input())
if a == 0:
	print('O-|-OOOO')
while a > 0:
	d = a % 10
	if d >= 5:
		print('-O|', end='')
		d -= 5
	else:
		print('O-|', end='')
	for i in range(d):
		print('O', end='')
	print('-', end='')
	for i in range(4 - d):
		print('O', end='')
	print('')
	a //= 10


a = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
n = input().strip()
n = str(int(n))
for i in reversed(n):
	print(a[int(i)])


n = input()
n = n[::-1]
for i in n:
	x = int(i)
	if x < 5:
		print('O-|', 'O' * x, '-', 'O' * (4 - x), sep='')
	else:
		t = x - 5
		print('-O|', 'O' * t, '-', 'O' * (4 - t), sep='')


n = int(input())
l = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
if n == 0:
	print(l[0])
while n > 0:
	x = n % 10
	n = n // 10
	print(l[x])


import functools
t = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
n = input()
for c in n[::-1]:
	print(t[c])


n = [int(x) for x in input()]
n.reverse()
for i in range(len(n)):
	if n[i] >= 5:
		print('-O|', end='')
		q = n[i] - 5
	else:
		print('O-|', end='')
		q = n[i]
	if q == 0:
		print('-OOOO')
	if q == 1:
		print('O-OOO')
	if q == 2:
		print('OO-OO')
	if q == 3:
		print('OOO-O')
	if q == 4:
		print('OOOO-')


n = input().strip()
for k in n[::-1]:
	ans = ''
	l = int(k)
	if l >= 5:
		l -= 5
		ans += '-O|'
	else:
		ans += 'O-|'
	for i in range(l):
		ans += 'O'
	ans += '-'
	for i in range(8 - len(ans)):
		ans += 'O'
	print(ans)


n = input()
for char in n[::-1]:
	x = int(char)
	if x < 5:
		r = 'O-|'
	else:
		r = '-O|'
	r += x % 5 * 'O' + '-' + (4 - x % 5) * 'O'
	print(r)


n = input()[::-1]
for x in n:
	if int(x) < 5:
		print('O-|', 'O' * int(x), '-', 'O' * (4 - int(x)), sep='')
	elif int(x) >= 5:
		print('-O|', 'O' * (int(x) - 5), '-', 'O' * (4 - (int(x) - 5)), sep='')


def soroban(s):
	z = list()
	for i in range(len(s)):
		if s[i] == '0':
			z.append('O-|-OOOO')
		if s[i] == '1':
			z.append('O-|O-OOO')
		if s[i] == '2':
			z.append('O-|OO-OO')
		if s[i] == '3':
			z.append('O-|OOO-O')
		if s[i] == '4':
			z.append('O-|OOOO-')
		if s[i] == '5':
			z.append('-O|-OOOO')
		if s[i] == '6':
			z.append('-O|O-OOO')
		if s[i] == '7':
			z.append('-O|OO-OO')
		if s[i] == '8':
			z.append('-O|OOO-O')
		if s[i] == '9':
			z.append('-O|OOOO-')
	return z[::-1]
print(*soroban(input()), sep='\n')


n = int(input())
for _ in range(len(str(n))):
	if n % 10 >= 5:
		print('-O|' + 'O' * (n % 10 - 5) + '-' + 'O' * (9 - n % 10))
	else:
		print('O-|' + 'O' * (n % 10) + '-' + 'O' * (4 - n % 10))
	n //= 10


n = list(input())
n = n[::-1]
for i in n:
	if int(i) >= 5:
		a = int(i) - 5
		b = 5 - (a + 1)
		print('-' + 'O' + '|' + 'O' * a + '-' + 'O' * b)
	else:
		a = int(i)
		b = 5 - (a + 1)
		print('O' + '-' + '|' + 'O' * a + '-' + 'O' * b)


dig = {'0': 'O-|-OOOO', '1': 'O-|O-OOO', '2': 'O-|OO-OO', '3': 'O-|OOO-O', '4': 'O-|OOOO-', '5': '-O|-OOOO', '6': '-O|O-OOO', '7': '-O|OO-OO', '8': '-O|OOO-O', '9': '-O|OOOO-'}
num = list(input())
num.reverse()
for i in num:
	print(dig[i])


n = input()
c = len(n) - 1
for i in n:
	m = int(n[c])
	z = m - 5
	if m == 5:
		print('-O|-OOOO')
	if m > 5:
		print('-O|', end='')
		print('O' * z + '-' + 'O' * (4 - z))
	if m < 5:
		print('O-|', end='')
		print('O' * m + '-' + 'O' * (4 - m))
	c -= 1


def solution(n):
	n.reverse()
	for x in n:
		x = int(x)
		c_out = ''
		if x < 5:
			c_out += 'O-|'
		else:
			c_out += '-O|'
		if x % 5 == 0:
			c_out += '-OOOO'
		elif x % 5 == 1:
			c_out += 'O-OOO'
		elif x % 5 == 2:
			c_out += 'OO-OO'
		elif x % 5 == 3:
			c_out += 'OOO-O'
		else:
			c_out += 'OOOO-'
		print(c_out)

def answer():
	n = list(input())
	solution(n)
answer()


def soroban(c):
	n = int(c)
	(l, r) = divmod(n, 5)
	return '-O|' * l + 'O-|' * (1 - l) + 'O' * r + '-' + 'O' * (4 - r)
s = input()
for i in range(len(s)):
	print(soroban(s[-i - 1]))


s = input()[::-1]
for c in s:
	c = int(c)
	if c < 5:
		print('O-|', end='')
	else:
		print('-O|', end='')
	t = ['O'] * 5
	t[c % 5] = '-'
	print(''.join(t))


d = {0: 'O-|-OOOO', 1: 'O-|O-OOO', 2: 'O-|OO-OO', 3: 'O-|OOO-O', 4: 'O-|OOOO-', 5: '-O|-OOOO', 6: '-O|O-OOO', 7: '-O|OO-OO', 8: '-O|OOO-O', 9: '-O|OOOO-'}
print('\n'.join([d[i] for i in reversed(list(map(int, list(input()))))]))


x = input()
for i in x[::-1]:
	i = int(i)
	if i < 5:
		k = 'O-|'
		for j in range(i):
			k = k + 'O'
		k += '-'
		for j in range(4 - i):
			k += 'O'
	else:
		k = '-O|'
		for j in range(i - 5):
			k += 'O'
		k += '-'
		for j in range(9 - i):
			k += 'O'
	print(k)


def main():
	print('\n'.join((('O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-')[_] for _ in reversed(list(map(int, input()))))))
main()


num = input()
for i in reversed(num):
	n = int(i)
	if n >= 5:
		print('-O|', end='')
		n = n - 5
	else:
		print('O-|', end='')
	if n == 4:
		print('OOOO-')
	elif n == 3:
		print('OOO-O')
	elif n == 2:
		print('OO-OO')
	elif n == 1:
		print('O-OOO')
	else:
		print('-OOOO')


n = int(input())

def printfunc(n):
	if n < 5:
		print('O-|', end='')
	else:
		print('-O|', end='')
	print(n % 5 * 'O', end='')
	print('-', end='')
	print((4 - n % 5) * 'O')
if n == 0:
	print('O-|-OOOO')
while n:
	printfunc(n % 10)
	n //= 10


n = input()
while n:
	k = int(n) % 10
	n = n[:len(n) - 1]
	if k > 4:
		print('-O|', end='')
		if (k - 5) % 4 == 0 and k != 5:
			print('O' * 4, '-', sep='')
			if k - 5 < 4:
				print('-', 'O' * (4 - k % 5), sep='')
		elif k == 5:
			print('-OOOO')
		else:
			print('O' * ((k - 5) % 4), end='')
			if k - 5 < 4:
				print('-', 'O' * (4 - k % 5), sep='')
	else:
		print('O-|', 'O' * k, '-', 'O' * (4 - k), sep='')


st = input()
m = len(st)
res = []
for i in range(m):
	arr = ['-'] * 8
	n = int(st[i])
	arr[2] = '|'
	if n >= 5:
		arr[1] = 'O'
		x = n - 5
		if x == 0:
			arr[4:] = ['O'] * 4
		else:
			arr[3:3 + x] = ['O'] * x
			arr[3 + x] = '-'
			arr[3 + x + 1:] = ['O'] * (4 - x)
	else:
		arr[0] = 'O'
		x = n
		if x == 0:
			arr[4:] = ['O'] * 4
		else:
			arr[3:3 + x] = ['O'] * x
			arr[3 + x] = '-'
			arr[3 + x + 1:] = ['O'] * (4 - x)
	res.append(''.join((x for x in arr)))
for i in range(m):
	print(res[m - i - 1])


N = input()

def soroban(n):
	ret = ''
	if n >= 5:
		ret += '-O|'
	else:
		ret += 'O-|'
	x = n % 5
	add = list('OOOOO')
	add[x] = '-'
	ret += ''.join(add)
	return ret
for n in reversed(list(N)):
	print(soroban(int(n)))


n = input()
con = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
l = len(n)
n = n[::-1]
for i in range(l):
	print(con[int(n[i])])


def solve(s):
	for i in range(len(s) - 1, -1, -1):
		c = int(s[i])
		r = ''
		l = ''
		if c < 5:
			r = 'O-'
		else:
			r = '-O'
		if c == 0:
			l = '-OOOO'
		elif c == 5:
			l = '-OOOO'
		elif c == 6 or c == 1:
			l = 'O-OOO'
		elif c == 7 or c == 2:
			l = 'OO-OO'
		elif c == 8 or c == 3:
			l = 'OOO-O'
		else:
			l = 'OOOO-'
		print(f'{r}|{l}', end='\n')

def main():
	s = input()
	solve(s)
main()


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
setrecursionlimit(10 ** 7)
RI = lambda : list(map(int, input().split()))
RS = lambda : input().rstrip().split()
n = RS()[0]
ans = ['O-|-OOOO', 'O-|O-OOO', 'O-|OO-OO', 'O-|OOO-O', 'O-|OOOO-', '-O|-OOOO', '-O|O-OOO', '-O|OO-OO', '-O|OOO-O', '-O|OOOO-']
for i in n[::-1]:
	print(ans[int(i)])


a = input()
a = a[::-1]
for c in a:
	if c == '0':
		print('O-|-OOOO')
	elif c == '1':
		print('O-|O-OOO')
	elif c == '2':
		print('O-|OO-OO')
	elif c == '3':
		print('O-|OOO-O')
	elif c == '4':
		print('O-|OOOO-')
	elif c == '5':
		print('-O|-OOOO')
	elif c == '6':
		print('-O|O-OOO')
	elif c == '7':
		print('-O|OO-OO')
	elif c == '8':
		print('-O|OOO-O')
	elif c == '9':
		print('-O|OOOO-')


def main_function():
	output_list = []
	n = input()
	for i in range(len(n)):
		if int(n[i]) == 5:
			s = '-' + 'O' + '|' + '-' + 'O' * 4
		elif int(n[i]) < 5:
			s = 'O' + '-' + '|' + 'O' * int(n[i]) + '-' + 'O' * (4 - int(n[i]))
		else:
			s = '-' + 'O' + '|' + 'O' * (int(n[i]) - 5) + '-' + 'O' * (9 - int(n[i]))
		output_list.append(s)
	output_list.reverse()
	return '\n'.join(output_list)
print(main_function())