URI Online Judge | 2671

Decoding the Text

By Hamilton José Brumatto, UESC BR Brazil

Timelimit: 1

Your colleague has a brilliant idea to encode a text, he will use an (almost) complete binary tree with the text distributed in the breadth, and it will present the result of an in order search of the tree. See the example, encoding: "A simple text".

Imagem

The result we will get on the search will be: "sot mseiUmxp lte". The problem is that although it can easily encode the texts, it can not decode them, and has asked you for an algorithm that receives a coded text and decodes it.

Input

The input contains several test cases, each test case starts with the integer N (0 < N < 200), indicating the amount of characters in the text (only characters of the printable ASCII pattern), in the next line there will be a text with N characters. The test cases end with N = 0.

Output

For each test case, in a single line, print the decoded text on the output.

Input Sample Output Sample

16
sot mseiUmxp lte
13
EG R2B0P1A7OS
0

Um texto simples
PROGBASE 2017