#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, k;
  string s;
  cin >> n >> k >> s;
  if (n == 1) {
    cout << s;
    for (int i = 0; i < k - 1; i++) cout << s;
    return 0;
  }
  string suffix = "";
  int maxx = 0;
  for (int i = 1; i < n; i++) {
    string pre = "", suff = "";
    for (int j = 0; j < i; j++) {
      pre += s[j];
      suff += s[n - 1 - j];
    }
    reverse(suff.begin(), suff.end());
    if (suff == pre) {
      suffix = "";
      for (int j = i; j < n; j++) suffix += s[j];
    }
  }
  if (suffix.size() == 0) {
    for (int i = 0; i < k; i++) cout << s;
    return 0;
  }
  cout << s;
  for (int i = 0; i < k - 1; i++) cout << suffix;
}
