#include <bits/stdc++.h>
using namespace std;
struct odd : public unary_function<int, bool> {
  bool operator()(int x) const { return (x % 2) != 0; }
};
void dis(int *Array, int N) {
  for (int i = 0; i < N; ++i) {
    std::cout.width(1);
    std::cout << Array[i];
  }
  std::cout << std::endl;
}
template <typename T, typename U>
inline signed amin(T &x, U y) {
  if (y < x) x = y;
  return x;
}
template <typename T, typename U>
inline signed amax(T &x, U y) {
  if (x < y) x = y;
  return x;
}
int main() {
  int a, arr[10];
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  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];
}
