The integer (19)10 (decimal representation) is represented as (10011)2 in the binary numeral system. This allows us to define the rotation to the right of a natural number as the operation that places the last digit of the binary representation before the first one. If we thus rotate the binary number (10011)2 to the right, we obtain the binary number (11001)2=(25)10. A given natural number can also be rotated to the right n-fold. In this case n successive rotations are executed on the binary representation of the number. As such, the 4-fold rotation to the right of 19 equals 7, as can be seen from the following series of rotations.

19 r 25 r 28 r 14 r 7
10011 11001 11100 01110 00111

If the binary representation of an integer has leading zeroes after a (n-fold) rotation to the right, the leading zeroes are deleted.

The inverted operation that places the first digit of the binary representation of an integer at the back, is logically called a rotation to the left of the integer. Analogous to a rotation to the right, an n-fold rotation to the left is defined as a repeated execution of a rotation to the left. Hence, the 4-fold rotation to the left of the number 357 equals 91, as can be seen from the following series of rotations.

357 l 203 l 406 l 301 l 91
101100101 011001011 110010110 100101101 001011011

Input

The input exists of two lines, the first containing a number gN, and the second a number nN.

Output

Execute an n-fold rotation of the number g, and write out the result of all intermediate steps. Execute a rotation to the right if n is positive, and a rotation to the left if n is negative. The following intermediate results must be written out:

Tip: use the built-in Python functions bin and int to convert the decimal representation of an integer to its binary representation and vice versa.

Example

Input:

19
4

Output:

19
10011
111
7

Example

Input

357
-4

Output:

357
101100101
1011011
91