#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, j, l, m;
  cin >> n >> k;
  string s;
  cin >> s;
  long long max, indx = 0, cnt = -1;
  for (i = 1; i < s.length(); i++) {
    if (s[i] == s[0]) {
      cnt = 1;
      for (j = i + 1; j < s.length(); j++) {
        if (s[j] != s[cnt]) {
          j = s.length();
        } else
          cnt++;
      }
      if (cnt >= indx && j == s.length()) indx = cnt;
    }
  }
  cout << s;
  k--;
  while (k > 0) {
    for (j = indx; j < s.length(); j++) cout << s[j];
    k--;
  }
  cout << endl;
}
