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: interview

Starter code:

Solutions:
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")


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().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)

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)


#Soroban

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 = 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-')

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");
        
        


'''
Created on Nov 11, 2013

@author: Ismael
'''
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()


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('')

x=int(input())


K={}

K[0]="O-|-OOOO"
K[1]="O-|O-OOO"
K[2]="O-|OO-OO"
K[3]="O-|OOO-O"
K[4]="O-|OOOO-"
K[5]="-O|-OOOO"
K[6]="-O|O-OOO"
K[7]="-O|OO-OO"
K[8]="-O|OOO-O"
K[9]="-O|OOOO-"

if(x==0):
    print("O-|-OOOO")

else:
    while(x!=0):
        d=x%10
        print(K[d])
        x//=10


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-')

3

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


#python 3.3

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])


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]))

__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]))


   # for iter in range(0, len(n)):
       # output=makeDigit(int(n[iter]))+"\n"
  #  return output

print(makeSoroban(n))





__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]))


   # for iter in range(0, len(n)):
       # output=makeDigit(int(n[iter]))+"\n"
  #  return output

print(makeSoroban(n))




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)])


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())
for i in range(len(str(n))-1,-1,-1):
    x=int(str(n)[i])
    if x==0:
        print('O-|-OOOO')
    if x==1:
        print('O-|O-OOO')
    if x==2:
        print('O-|OO-OO')            
    if x==3:
        print('O-|OOO-O')                
    if x==4:
        print('O-|OOOO-')                    
    if x==5:
        print('-O|-OOOO')                        
    if x==6:
        print('-O|O-OOO')  
    if x==7:
        print('-O|OO-OO')                                
    if x==8:
        print('-O|OOO-O')            
    if x==9:
        print('-O|OOOO-')

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='')


__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))

def __starting_point(): main()
__starting_point()

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 = input()[::-1]
res = ""
for i in n:
    i = int(i)
    if i < 5:
        res += "O-|"
        res += "O" * i + "-" + "O" * (4 - i)
    else:
        res += "-O|"
        res += "O" * (i - 5) + "-" + "O" * (9 - i)
    print(res)
    res = ""


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)


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-')