G - Farmer John and the Encryption System

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

Input

Output

Sample test(s)

Input
8 abbccddd
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
dddbbcca
--- Showing first 30 lines (click "Copy" to get full content) ---
Input
8 abcdwxyz
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
abcdwxyz
--- Showing first 30 lines (click "Copy" to get full content) ---