시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB76556849776.698%

문제

You may have seen a mechanic typewriter — such devices were widespread just 15 years ago, before computers replaced them. It is a very simple thing. You strike a key on the typewriter keyboard, the corresponding type bar rises, and the metallic letter molded into the type bar strikes the paper. The art of typewriter typing, however, is more complicated than the art of computer typing. You should strike keys with some force otherwise the prints will not be dark enough. Also you should not overdo it otherwise the paper will be damaged.

Imagine a typewriter with very sharp letters, which cut the paper instead of printing. It is clear that digit 0 being typed on the typewriter makes a nice hole in the paper and you receive a small paper oval as a bonus. The same happens with some other digits: 4, 6, 9 produce one hole, and 8 produces two touching holes. The remaining digits just cut the paper without making holes.

The Jury thinks about some exhibition devoted to the oncoming jubilee of Pascal language. One of the ideas is to make an art installation, consisting of an empty sheet of paper with exactly h (0 ≤ h ≤ 510) holes made by typing a non-negative integer number on the cutting typewriter described above. The number must be minimal possible and should not have leading zeroes. Unluckily we are too busy with preparing the ACM quarter- and semifinals, so we need your help and ask you to write a computer program to generate the required number.

입력

A single integer number h — the number of holes.

출력

The integer number which should be typed.

예제 입력 1

0

예제 출력 1

1

예제 입력 2

1

예제 출력 2

0

예제 입력 3

15

예제 출력 3

48888888

예제 입력 4

70

예제 출력 4

88888888888888888888888888888888888