Takahashi has a string S of length N consisting of lowercase English letters. On this string, he will perform the following operation K times:

* Let T be the string obtained by reversing S, and U be the string obtained by concatenating S and T in this order.
* Let S' be some contiguous substring of U with length N, and replace S with S'.



Among the strings that can be the string S after the K operations, find the lexicographically smallest possible one.

Constraints

* 1 \leq N \leq 5000
* 1 \leq K \leq 10^9
* |S|=N
* S consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:


N K
S


Output

Print the lexicographically smallest possible string that can be the string S after the K operations.

Examples

Input

5 1
bacba


Output

aabca


Input

10 2
bbaabbbaab


Output

aaaabbaabb

"""

https://atcoder.jp/contests/agc037/tasks/agc037_e

辞書順最小の文字をAとする
できるだけAが先頭にたくさん並ぶようにしたい

XAYのとき
XAYYAX　となる。これが最後の場合はAを先頭にして取るのがよい
そうでなければ一番後ろがAになるようにとるのが正解？

3なら
YYA → YYAAYY
YAA → YAAAAY
AAA → …

と、Kが5000回以上あるなら絶対全部Aにできる
実際は、Aの長さは倍倍に増えていくのでlog5000回ぐらいで全部Aにできる

Aとして選ぶべき場所は、最長ならそれ
最長が複数ある場合、それ以降の並びが辞書順最小のモノを選ぶべき

実装が面倒くさい系だな…

"""

import sys
N,K = map(int,input().split())
S   = input()

if K == 1:

    u = S + S[::-1]
    #print (u)
    lis = []
    for i in range(N+1):
        lis.append(u[i:i+N])
    lis.sort()
    print (lis[0])
    sys.exit()

else:

    u = S + S[::-1]
    #print (u)
    lis = []
    for i in range(N+1):
        lis.append(u[i:i+N])
    lis.sort()

    SR = lis[0]
    S  = lis[0][::-1]

    LL = 0
    for i in range(1,N):
        if SR[i] != SR[i-1]:
            LL = i
            break
    else:
        LL = N

    for i in range(2,K+1):

        u = S + S[::-1]
        
        SR = u[N-LL:2*N-LL]
        S  = SR[::-1]
        LL *= 2

        if LL >= N:
            break

    print (SR)
