Олимпиадный тренинг

Задача 27087. smooth numbers


Задача

Темы: Перестановки

Let's call a number smooth if its digits form a non-decreasing sequence starting from the most significant digit. Sort these numbers in ascending order and assign a number to each. Required by number N output N-th smooth number.

Input
The program input number N (\(1 <= N <= 2147483647\)).

Imprint
Print corresponding to the number N smooth number.



Examples
# Input Output
1 3 3
2 11 12