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
#include<bits/stdc++.h>
#define N 10010
#define mo 1000010009
using namespace std;
int n,k,s[N],sm[N],pw[N];
bool eq(int l,int r,int L,int R){
	return 1ll*(sm[R]-sm[L]+mo)*pw[l]%mo==1ll*(sm[r]-sm[l]+mo)*pw[L]%mo;
}
int main(){
	scanf("%d %d\n",&n,&k);
	for(int i=1;i<=n;++i)s[n+n+1-i]=s[i]=getchar()-96;
	pw[0]=1;for(int i=1;i<=n+n;++i)pw[i]=31ll*pw[i-1]%mo;
	for(int i=1;i<=n+n;++i)sm[i]=(sm[i-1]+1ll*pw[i]*s[i])%mo;
	int ps=n;
	for(int i=n+1;i<=n+n;++i){
		int l=0;
		for(int j=12;j+1;--j)if(l+(1<<j)<=n)
			if(eq(ps-l-(1<<j),ps,i-l-(1<<j),i))l+=1<<j;
		if(l<n&&s[i-l]<s[ps-l])ps=i;
	}
	--k;
	while(k--){
		for(int i=1;i<=n;++i)s[i]=s[ps-n+i];
		for(int i=1;i<=n;++i)s[n+n+1-i]=s[i];
		int Q=1;
		for(int i=1;i<n;++i)if(s[i]^s[i+1])Q=0;
		if(Q)break;
		ps=n;while(s[ps+1]==s[ps])++ps;
	}ps=n+1;
	for(int i=1;i<=n+n;++i)sm[i]=(sm[i-1]+1ll*pw[i]*s[i])%mo;
	for(int i=1;i<=n;++i){
		int l=0;
		for(int j=12;j+1;--j)if(l+(1<<j)<=n)
			if(eq(ps+l+(1<<j)-1,ps-1,i+l+(1<<j)-1,i-1))l+=1<<j;
		if(l<n&&s[i+l]<s[ps+l])ps=i;
	}
	for(int i=1;i<=n;++i)putchar(s[ps+i-1]+96);
}