High School Programming League 2008/2009

Suan Pan

Problem code: HS08SUAN

Johnny's fabulous birthday party turned out more costly than he had expected. So, once again, he ran to Leo's shop, this time asking for a holiday job. Leo agreed to hire Johnny, but he expects that Johnny learns to operate the abacus which Leo uses for totting up bills - as soon as possible!

Leo's first task for Johnny was as follows. The old man said:

"Here is a Chinese abacus which you can use for calculations both in the decimal system, and in the hexadecimal system. Successive digits in the hexadecimal system are represented by successive columns of the abacus, starting from the right. In each of the upper rows one bead has a value of 5, in each of the lower rows - a value of 1. Your task is to represent a decimal number, given on a sheet of paper, in the form of a hexadecimal number on the abacus. You must do all the necessary arithmetic yourself, assisted only the abacus, if you wish."

Help Johnny find a solution to his problem!

Input

Every data set consists of one positive integer D given in the decimal system with at most 30 digits.

Output

Write to output the correct state of the Chinese abacus, representing the value of D in the hexadecimal system. Assume that the number of columns of the abacus is equal to 30.

Example 1

Input:
251

Output:
------------------------------
oooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
                            oo
------------------------------
                            oo
ooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooo o
------------------------------

Example 2

Input:
28724239499488423

Output:
------------------------------
ooooooooooooooooooo o o   o  o
oooooooooooooooo  oo ooooo oo
                oo ooo ooooooo
------------------------------
                oo ooooooooo o
oooooooooooooooo  ooo o oo ooo
ooooooooooooooooooo oo o oo o
oooooooooooooooooooo ooooooooo
oooooooooooooooooooooooooooooo
ooooooooooooooooooooooooo oooo
------------------------------

Scoring

For every test data you can get 1, 2 or 3 points, summing to a total of 10 points.


Added by:Michał Małafiejski
Date:2008-10-22
Time limit:1s
Source limit:50000B
Languages:SED C99 strict C++ 4.0.0-8 C++ 4.3.2 TCL SCALA NEM PHP SCM guile LISP sbcl LISP clisp ERL TECS TEXT DOC PDF PS PERL 6 JS
Resource:High School Programming League 2008/2009
SPOJ System © 2008-2009 Sphere Research Labs. All Rights Reserved.