Олимпиадный тренинг

Задача 39062. broken printer


A broken color printer, printing numbers, paints all enclosed areas red.  For example, the numbers 04, 6, 9 have one closed area.  In the figure 8 - 2 closed areas.  In other numbers, there are no closed areas that are painted over. There are h closed areas remaining in the red printer for painting.  Find the minimum non-negative number that will print out the red ink in the printer. The number must not contain leading zeros.  If the printer is out of red ink, it cannot print a closed area number.


Input
The input is a number h (0 <= h <= 510).

Imprint
Output the number to be printed.
 
Examples
# Input Output
1 15 48888888
2 70 8888888888888888888888888888888888