#include <bits/stdc++.h>
using namespace std;
vector<int> next;
int main(void) {
  int n, k;
  string t;
  cin >> n >> k >> t;
  size_t len = t.length();
  ::next.resize(len + 1, 0);
  ::next[0] = -1;
  int i = 0, j = -1;
  while (i < len) {
    if (j == -1 || t[j] == t[i]) {
      i++, j++;
      ::next[i] = j;
    } else
      j = ::next[j];
  }
  cout << t;
  k -= 1;
  while (k--)
    for (size_t i = ::next[len]; i < len; i++) cout << t[i];
  return 0;
}
