14287 - Escape the spider web   

Description

You are a traveler journeying around the world. One day, you enter a forest and accidentally get stuck in a giant spider web. In order for the spider to spare you, it demands that you count the layers of its web. However, the spider only has 8 legs, so it can't count to 8. For example, while humans can count 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, spiders can only count 1, 2, 3, 4, 5, 6, 7, 10, 11, 12. Therefore, to escape the spider web, you must count the layers of the web and then convert the number into a form the spider can understand.

Input

Multiple lines of input, each line represents the layer of the spider web in humans' counting way.

Output

Print the number in spiders' format line by line.

Sample Input  Download

Sample Output  Download

Tags




Discuss