#arc153a. [arc153_a]AABCDDEFE

[arc153_a]AABCDDEFE

Problem Statement

A positive integer xx is said to be a beautiful integer if and only if xx is a 99-digit integer whose decimal notation S1ldotsS9S_1\\ldots S_9 (SiS_i is the ii-th character) satisfies all of the following conditions:

  • S1S_1 is not 0,
  • S1=S2S_1 = S_2,
  • S5=S6S_5 = S_6, and
  • S7=S9S_7 = S_9.

For instance, 998244353998244353 and 333333333333333333 are beautiful integers, while 111112222111112222 is not, since S5neqS6S_5 \\neq S_6.

You are given a positive integer NN. Print the NN-th smallest beautiful integer.

Constraints

  • NN is a positive integer.
  • There are at least NN beautiful integers.

Input

The input is given from Standard Input in the following format:

NN

Output

Print the NN-th smallest beautiful integer.


Sample Input 1

3

Sample Output 1

110000020

The beautiful integers in ascending order are 110000000,110000010,110000020,ldots110000000, 110000010, 110000020, \\ldots.


Sample Input 2

882436

Sample Output 2

998244353

Sample Input 3

2023

Sample Output 3

110200222