Under construction

Still being built. Things may change

Geongong String

Time limit1sMemory limit1024 MB

Summary
Given a string S and a window length K, reverse each length-K window from left to right and print the final string.
Level

Medium5 of 10

Topics
Simulation, String, Queue
Solved
No attempts yet

Problem

You are given positive integers NN and KK, and a string SS of length NN made of lowercase English letters.

Define reverse(i) as the operation that reverses the substring of SS formed by the characters at positions i,i+1,…,i+K−1i, i+1, \ldots, i+K-1.

Perform reverse(i) for i=1,2,⋯ ,N−K+1i = 1, 2, \cdots, N-K+1 in that order. The final string after all these operations is called the geongong string. Print it.

Input

The first line contains two integers NN and KK, separated by a space. (1≤K≤N≤500 0001 \le K \le N \le 500\ 000)

The second line contains the string SS of length NN, made of lowercase English letters only.

Output

Print the geongong string.

Hint

Examples1

  1. Example 1

    Input
    5 3
    cpuos
    
    Expected output
    uospc