#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1;
  int x = 0, m, n;
  cin >> m >> n;
  cin >> s1;
  for (int i = 0; i < m; i++) {
    if (s1.substr(0, i) == s1.substr(m - i, i)) x = i;
  }
  if (x == 0) {
    for (int i = 0; i < n; i++) cout << s1;
  } else {
    cout << s1;
    string s2 = s1.substr(x);
    for (int i = 1; i < n; i++) cout << s2;
  }
}
