#include <bits/stdc++.h>
using namespace std;
int next1[100];
void getNext(char p[]) {
  int len = strlen(p);
  next1[0] = 0;
  int i = 0, j = 0;
  for (j = 1; j < len; j++) {
    while (p[i] != p[j] && i > 0) i = next1[i - 1];
    if (p[i] == p[j]) {
      i++;
      next1[j] = i;
    } else
      next1[j] = 0;
  }
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  char p[100];
  cin >> p;
  int len = strlen(p);
  getNext(p);
  int kk = next1[len - 1];
  for (int i = 0; i < kk; i++) {
    printf("%c", p[i]);
  }
  while (k--) {
    for (int i = kk; i < len; i++) printf("%c", p[i]);
  }
  cout << endl;
  return 0;
}
