Faro Shuffle


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

At the Blackjack table, you notice some dealers doing the faro shuffle. The faro shuffle is a method for shuffling a deck of cards, in which the deck is split into 2 packets of equal size, and the packets are perfectly interweaved with each other. When the shuffle is performed, the original card at the top of the deck stays at the top of the deck.

For example, to shuffle the deck 12345678, it would be split into 2 packets, 1234 and 5678, and then interweaved in the following way:

1 2 3 4
 5 6 7 8

Result:
15263748

You think this could be a nice way to hide a secret message. You could write a character on each card, and then after a certain amount of faro shuffles, your secret message would appear.

Given a deck of cards and the amount of shuffles needed to reveal the answer, what is the final ordering of the cards?

Input

The first line consists of an integer n (0 \leq n \leq 10^9), the number of times the shuffle should be done.

The next line consists of a word of length c (2 \leq c \leq 10^5) consisting of uppercase characters, lowercase characters, numbers, and special characters _, and -. This string represents the order of the cards in the deck, with the first character being the first card, the second character being the second, and so forth.

It is guaranteed that the number of cards in the deck is even.

Output

Print the result of the deck after all the shuffles have been completed.

Example

Input
2
AADIEDLE
Output
ADELAIDE

The faro shuffle is performed 2 times. Below is a visualization of what happens at each shuffle.

Shuffle 1:

Split:
AADI EDLE

Shuffle:
A A D I
 E D L E

Result:
AEADDLIE

Shuffle 2:

Split:
AEAD DLIE

Shuffle:
A E A D
 D L I E

Result:
ADELAIDE

Comments

There are no comments at the moment.