#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string t;
  cin >> t;
  string second = "";
  int lap = 0;
  for (lap = t.size() - 1; lap > 0; lap--) {
    if (t.substr(0, lap) == t.substr(n - lap, lap)) break;
  }
  second += t;
  for (int i = 1; i < k; i++) second += t.substr(lap, n - lap);
  cout << second << endl;
}
