COCI '10 Contest 1 #3 Sretan
View as PDFDigits and
are lucky, while all others are unlucky. An integer is lucky if it contains only lucky digits
in decimal notation. We would like to know the
-th lucky positive integer.
Input Specification
The first and only line of input contains a positive integer
.
Output Specification
The first and only line of output must contain the -th lucky positive integer.
Sample Input 1
1
Sample Output 1
4
Sample Input 2
2
Sample Output 2
7
Sample Input 3
3
Sample Output 3
44
Comments