#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, arr[10];
  long long n, k;
  string s, t, u;
  cin >> n >> k;
  cin >> s;
  for (int i = 1; i <= k; i++) {
    reverse(s.begin(), s.end());
    t = s;
    reverse(s.begin(), s.end());
    u = s + t;
    if (i == k) {
      break;
    } else {
      s.clear();
      s += u;
      t.clear();
      u.clear();
    }
  }
  reverse(u.end(), u.begin());
  for (int i = n * k - k; i < n * k - 1 + n; i++) cout << u[i];
}
