Graded lexicographic order#1130

Graded lexicographic order

3 seconds
32 megabytes
Easy

Consider the integers from to . Define the weight of a number as the sum of its digits. Let the weight of be denoted as .

Arrange these numbers in graded lexicographic order. For two numbers and : if w(a) < w(b), then comes before in graded lexicographic order. If w(a) = w(b), then comes before if and only if the decimal representation of is lexicographically less than the decimal representation of .

For example, in this order:

Given and , find the number at the -th position in the graded lexicographic ordering of natural numbers from to .

Input

The input file contains two integers and (1 \leq k \leq n \leq 10^{18}).

Output

Output the position number on the first line.

Output the number at the -th position on the second line.

Examples

Example 1

Loading
Loading