#include <bits/stdc++.h>
using namespace std;
int next1[60];
char s[60];
void get_next(char *t, int *next1) {
  int i = 0, j = -1;
  next1[0] = -1;
  int len = strlen(t);
  while (i < len) {
    if (j == -1 || t[i] == t[j]) {
      i++;
      j++;
      next1[i] = j;
    } else
      j = next1[j];
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  cin >> s;
  get_next(s, next1);
  int p = next1[n];
  printf("%s", s);
  if (m > 1) {
    for (int i = 0; i < m - 1; i++) {
      for (int j = p; j < n; j++) {
        printf("%c", s[j]);
      }
    }
  }
}
