eolymp
bolt
Try our new interface for solving problems
Problems

Lexicographical order

Lexicographical order

We assume that one positive integer is lexicographically smaller than the other, if their symbol representation in decimal system in the same order

Find the k-th number in lexicographical sorted order of all integer from 1 to n inclusively.

Input

The first line contains two numbers n and k (1kn109).

Output

Print one number - the k-th element in lexicographical order of all integer from 1 to n inclusively.

Time limit 1 second
Memory limit 64 MiB
Input example #1
10 2
Output example #1
10