Large numbers#2610

Large numbers

1 second
64 megabytes
Easy

At the -th position in the sequence is the largest integer with digits, where every pair of adjacent digits is different.

Input

A natural number (1 \leq k \leq 100000).

Output

Output the -th number in the sequence.

Examples

Example 1

Loading
Loading