CPython lite logoProblemsContests

38. Sum of Digits (Reverse Problem)

Find the smallest number whose digits sum up to n.


Input

The first line contains a natural number not greater than 50.

Output

A single line containing the solution to the problem.


Sample input 1

5

Sample output 1

5

Sample input 2

10

Sample output 2

19

Sample input 3

18

Sample output 3

99

Login to be able to submit.

NormalLoops
201 / 13
Solved / unsolved count
1.0 s / 512 MB
Limits