#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n, ch = 0;
  string s, g;
  cin >> n >> k >> s;
  for (int i = 1; i <= n && ch == 0; i++) {
    string t = s.substr(0, i);
    string temp = "\0";
    int count;
    (n % i == 0) ? count = n / i : count = (n / i) + 1;
    for (int j = 0; j < count; j++) temp += t;
    if (temp.find(s) == 0) {
      g = t;
      ch++;
    }
  }
  string l = "\0";
  for (int i = 0; i < k - 1; i++) l += g;
  l += s;
  cout << l << endl;
}
