P7750 [COCI 2013/2014 #2] SLOM

Description

Martin has something wrong with his eyes. For a word, each time he blinks, the letters of the word change in his eyes as follows (the phrases “the $k$-th from the end”, “the $k$-th”, etc. all refer to the word **before** the change): - The last letter is moved to between the $1$-st and $2$-nd letters. - The second-to-last letter is moved to between the $2$-nd and $3$-rd letters. - $\ldots\ \ldots$ - The $k$-th letter from the end is moved to between the $k$-th and $(k+1)$-th letters. For example, the word $\tt abcdef$ will become $\tt afbecd$ after he blinks. If Martin blinks again, the same thing will happen again. Given the number of times Martin blinks $X$ and the word $s$ that he sees, find the original word.

Input Format

The first line contains an integer $X$, representing the number of times Martin blinks. The second line contains a string $s$, representing the word Martin sees.

Output Format

Output one line with one string: the original word.

Explanation/Hint

#### Explanation for Sample 1 The transformation process is: $\tt abcdef\to afbecd\to adfcbe\to aedbfc\to acefdb$. #### Constraints - For $50\%$ of the testdata, $1\le X\le 100$. - For $100\%$ of the testdata, $1\le X\le 10^9$, $3\le |s|\le 10^3$. #### Source **This problem is translated from [COCI2013-2014](https://hsin.hr/coci/archive/2013_2014/) [CONTEST 2](https://hsin.hr/coci/archive/2013_2014/contest2_tasks.pdf) _T3 SLOM_.** According to the original testdata settings, the full score for this problem is $100$ points. Translated by ChatGPT 5