#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vector<int> PS;
  PS.resize(n);
  int j = 0;
  for (int i = 1; i < n; i++) {
    while (j > 0 && s[i] != s[j]) j = PS[j - 1];
    if (s[i] == s[j]) j++;
    PS[i] = j;
  }
  int m = PS[n - 1];
  cout << s;
  for (int i = 1; i < k; i++) {
    for (int j = m; j < n; j++) {
      cout << s[j];
    }
  }
}
