#include <bits/stdc++.h>
using namespace std;
char a[1000001];
int n, x, y;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> x;
  cin >> a + 1;
  cout << a + 1;
  x--;
  y = n + 1;
  for (int i = 2; i <= n; i++) {
    bool bo = true;
    int p = 0;
    for (int j = i; j <= n; j++) {
      p++;
      if (a[p] != a[j]) {
        bo = false;
        break;
      }
    }
    if (bo) {
      y = i;
      break;
    }
  }
  while (x--) {
    for (int i = n - y + 2; i <= n; i++) cout << a[i];
  }
}
