#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
string s;
string ans;
int main() {
  int n, k, mark;
  scanf("%d%d", &n, &k);
  cin >> s;
  mark = n;
  for (int j = 1; j < n; j++) {
    int flag = 0;
    for (int k = 0; k + j < n; k++) {
      if (s[k] != s[j + k]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      mark = j;
      break;
    }
  }
  mark = n - mark;
  ans.clear();
  for (int i = mark; i < n; i++) ans += s[i];
  cout << s;
  k--;
  while (k--) cout << ans;
  cout << endl;
  return 0;
}
