Task from an old DPA#3144

Task from an old DPA

1 second
64 megabytes
Medium

Rows (strings of digits) are constructed according to the following rule:

The first row consists of a single character, the digit . Each subsequent row is formed by first writing the row number (without leading zeros), followed by the previous row appended twice.

Here are the first rows created according to this rule:

For instance, the -th row will begin as follows:

...

Given and , determine which digit appears in the -th row at the -th position, or if the row's length is less than .

Input

Two natural numbers and are given (1 \le N \le 100\ 000, 1 \le K \le 10^{15}).

Output

Output the digit located at the -th position in the -th row. If the -th row is shorter than , output (minus one).

Examples

Example 1

Loading
Loading