The important thing is also the fact, where the representatives sit in the Parliament. Some of them prefer front rows because of more light, some prefer back rows because of less light and more silence. The others want to sit by the window. Moreover, the sitting order must be kept absolutely secret, because the neighbouring representatives may influence each other. Since we do not want to have corruption in the Parliament, it was decided to use Hyper-secret Code to encrypt the numbers of seats. The Hyper-secret Code of length n is designated SK(n) and consists of all possible binary strings of length n. That means it always has 2n elements. The Code is generated using the following recursive algorithm:
At the first line there is a positive integer N stating the number of assignments to follow. Each assignment consists of two lines. The first line contains an integer number k, 1 <= k <= 30. At the second line, there is the Hyper-secret Code consisting of exactly k characters. Each of the characters is either 0 or 1.
The program should print the line for each assignment. The line must contain the sentence "Poslanec P se posadi na sedadlo cislo S." (The representative #P sits down at the seat S). Fill the number of the assignment (starting with one) instead of P, and the right number of a seat instead of S - it means the possition of the given string in the Code SK(k).
5 1 0 4 0000 4 1000 4 1111 8 10101010
Poslanec 1 se posadi na sedadlo cislo 1. Poslanec 2 se posadi na sedadlo cislo 1. Poslanec 3 se posadi na sedadlo cislo 16. Poslanec 4 se posadi na sedadlo cislo 11. Poslanec 5 se posadi na sedadlo cislo 205.