#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int l = 0, m = 0;
  for (int i = 1; i < n; i++) {
    int j = i;
    while (j < n && l < n && s[l] == s[j]) l++, j++;
    if (j == n) {
      m = l;
      break;
    }
    l = 0;
  }
  int ans = n - m;
  string p = s.substr(m, ans);
  for (long long j = 0; j < k - 1; j++) s += p;
  cout << s << endl;
}
