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 <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;

vector<int> suffix_array(string S) {
	vector<int> arr(S.size() + 1, 0);
	for (int i = 0; i < S.size(); i++) arr[i] = (S[i] - 'a') + 1;

	for (int i = 0; i < 18; i++) {
		vector<tuple<int, int, int>> tup;
		for (int j = 0; j < S.size(); j++) {
			tup.push_back(make_tuple(arr[j], arr[min((int)S.size(), j + (1 << i))], j));
		}
		sort(tup.begin(), tup.end());
		int id = 0;
		for (int j = 0; j < tup.size(); j++) {
			arr[get<2>(tup[j])] = id + 1;
			if (j + 1 < tup.size() && make_pair(get<0>(tup[j]), get<1>(tup[j])) != make_pair(get<0>(tup[j + 1]), get<1>(tup[j + 1]))) id = j + 1;
		}
	}
	vector<int> ret; for (int i = 0; i < S.size(); i++) ret.push_back(arr[i]);
	return ret;
}

int N, K; string S;

int main() {
	cin >> N >> K >> S; K = min(K, 15);

	for (int i = 0; i < K; i++) {
		string V = S; reverse(V.begin(), V.end());
		string W = S + V;
		vector<int> J = suffix_array(W);

		int minx = (1 << 30), ind = 0;
		for (int j = 0; j <= N; j++) {
			if (minx > J[j]) { minx = J[j]; ind = j; }
		}
		if (i != K - 1) { ind = N - ind; }
		S = W.substr(ind, N);
	}
	cout << S << endl;
	return 0;
}