#include <bits/stdc++.h>
using namespace std;
unsigned short n, k, i, h;
string s;
int main() {
  cin >> n >> k >> s;
  for (unsigned short i = 0; i < n - 1; i++) {
    if (s.substr(0, i + 1) == s.substr(n - i - 1)) {
      h = i + 1;
    }
  }
  cout << s;
  for (unsigned short j = 0; j < k - 1; j++) {
    cout << s.substr(h);
  }
  return 0;
}
