Binary Counting

Generate the binary representation of each non-negative integer in order, concatenate the digits, and print every n-th digit starting at position k (five of them).

Medium4ImplementationMathSimulationStringInterviewNo attempts yetTime limit1sMemory limit32 MB

Problem

There is a drinking game where players count upward from 0 in turn. Each number is written in binary and spoken one digit at a time from the most significant digit.

For instance, 0 to 7 in binary are 0, 1, 10, 11, 100, 101, 110, 111, so the spoken digits in order are 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1.

One player wants to know in advance the digits for the turns that fall to that player. Write a program that reads the number of players and the position of the player and outputs the five digits the player will speak.

Input

The first line contains the number of players nn and the position kk of the player, separated by a space. They satisfy 1kn1001 \le k \le n \le 100.

Output

Print the five digits the player speaks on the turns that fall to that player, in order. Separate the digits with spaces and print them in one line.

Hint

The spoken digit sequence begins 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, and continues. The first input selects the 1st, 5th, 9th, 13th, and 17th digits from this sequence, and the second input selects the 3rd, 8th, 13th, 18th, and 23rd digits.