#arc153a. [arc153_a]AABCDDEFE
[arc153_a]AABCDDEFE
Problem Statement
A positive integer is said to be a beautiful integer if and only if is a -digit integer whose decimal notation ( is the -th character) satisfies all of the following conditions:
- is not
0
, - ,
- , and
- .
For instance, and are beautiful integers, while is not, since .
You are given a positive integer . Print the -th smallest beautiful integer.
Constraints
- is a positive integer.
- There are at least beautiful integers.
Input
The input is given from Standard Input in the following format:
Output
Print the -th smallest beautiful integer.
Sample Input 1
3
Sample Output 1
110000020
The beautiful integers in ascending order are .
Sample Input 2
882436
Sample Output 2
998244353
Sample Input 3
2023
Sample Output 3
110200222