﻿ URI 2111 - Understanding Sorobov
URI Online Judge | 2111

# Understanding Sorobov

By XVII Maratona de Programação IME-USP, 2013 Brazil

Timelimit: 1

Tools that help calculate existed for centuries. Long before the advent of calculators in the seventeenth century, Chinese and Japanese were using abacus to do sophisticated mathematical operations on blinding speed. A similar instrument was recently discovered in excavations near the city of Yekaterinburg. Believed to be similar to the Japanese abacus, called, in Russian, sorobov (copoбo).

The sorobov has nine columns, where each column corresponds to a digit. The rightmost column is the unit, the second most on the right represents the tens and so on. There are 7 lines, the first two being separated by a stripe, of the last 5. At the top (first two rows), each column has a single stone which is pressed against the spacer bar adds 5 to the value of the corresponding digit. At the bottom of each column there are 4 stones and an empty space and the amount of stones between the spacer bar and the empty space is added to the value of the corresponding digit. Thus, we say that the stones above are worth 5 and those below are 1.

Figure 1: Illustration of how to represent numbers 0 to 9.

Your task in this problem will be, given a number N print the representation of the sorobov configuration related to that number.

## Input

The input consists of several instances and ends with the end of file (EOF).

Each instance corresponds to a single line containing the number N to be inserted in sorobov.

## Output

For each instance print the representation of the number N (0 ≤ N < 109) sorobov in the following format.

The first two rows correspond to the stones that worth 5, the next line print --------- (nine dashes) and the next five lines correpondem the stones that worth 1. Each row of stones must contain 5 characters, '0' representing an empty spot and '1' representing a stone. Print a blank line after each instance (including the last).

 Sample Input Sample Output 2 16 111111111 000000000 --------- 000000001 111111111 111111110 111111111 111111111 111111110 000000001 --------- 000000011 111111100 111111111 111111111 111111111