G - Farmer John and the Encryption System

Languages: C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
8 abbccddd
Output
dddbbcca
Input
8 abcdwxyz
Output
abcdwxyz