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>
using namespace std;

#define INF int(1e9)
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> pii;

const int maxn=5005;
int n,k;
char s[maxn*2];

int main(){
	scanf("%d%d%s",&n,&k,s);
	int mn=INF;
	rep(i,n)mn=min(mn,int(s[i]));
	rep(i,n)s[n+i]=s[n-1-i];
	if(k==1){
		int pos=0;
		REP(i,n-1){
			bool f=false;
			rep(j,n)if(s[pos+j]!=s[i+j]){
				f=(s[i+j]<s[pos+j]);
				break;
			}
			if(f)pos=i;
		}
		for(int i=pos;i<pos+n;i++)putchar(s[i]);
		return 0;
	}
	int pos=-1,len=0;
	rep(i,2*n){
		int j=i;
		while(j<2*n&&s[j]==s[i])j++;
		if(s[i]==mn&&j-n>=0){
			int cur=j-i;
			if(cur>=n){
				REP(i,n)putchar(mn);
				return 0;
			}
			if(cur>len)len=cur,pos=i-1;
			else if(cur==len){
				bool f=false;
				rep(k,n-len)if(s[pos-k]!=s[i-1-k]){
					f=(s[i-1-k]<s[pos-k]);
					break;
				}
				if(f)pos=i-1;
			}
		}
		i=j-1;
	}
	REP(i,k-1){
		len*=2;
		if(len>=n){
			REP(i,n)putchar(mn);
			return 0;
		}
	}
	REP(i,len)putchar(mn);
	rep(i,n-len)putchar(s[pos-i]);
	return 0;
}