Unhappy with the dim lighting in his barn, Farmer John has installed a fancy new chandelier made of $N$ ($3 \le N \le 16$) light bulbs arranged in a circle.
The cows are fascinated by the new fixture and enjoy the following game. At each time step $T$, a bulb toggles its state (on↔off) if and only if its left neighbor was on at time $T-1$. The bulbs form a circle, so the left neighbor of bulb $1$ is bulb $N$. The cows repeat this for $B$ ($1 \le B \le 10^{15}$) time steps. Note that $B$ may exceed the range of a 32-bit integer.
Given the initial states of the bulbs, determine their states after exactly $B$ time steps.
With $N = 5$ bulbs where only the first is initially on (1 0 0 0 0), the states evolve as follows:
| Time | States |
|---|---|
| $T=0$ | 1 0 0 0 0 |
| $T=1$ | 1 1 0 0 0 |
| $T=2$ | 1 0 1 0 0 |
| $T=3$ | 1 1 1 1 0 |
| $T=4$ | 1 0 0 0 1 |
| $T=5$ | 0 1 0 0 1 |
| $T=6$ | 1 1 1 0 1 |
So after $B = 6$ steps the bulbs read 1 1 1 0 1.