#include <bits/stdc++.h>
using namespace std;
void get_next(string p, char nex[]) {
  int q, k;
  int m = p.length();
  nex[0] = 0;
  for (q = 1, k = 0; q < m; ++q) {
    while (k > 0 && p[q] != p[k]) k = nex[k - 1];
    if (p[q] == p[k]) {
      k++;
    }
    nex[q] = k;
  }
}
int main() {
  string p;
  char a[100] = {0};
  int n, k;
  cin >> n >> k;
  k--;
  cin >> p;
  get_next(p, a);
  int len = a[n - 1];
  while (k--) p = p + p.substr(len, n - len);
  cout << p;
  return 0;
}
