#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  char c[55];
  cin >> n >> k >> c;
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    int same = 0;
    if (c[i] == c[n - 1]) {
      int ok = 1;
      for (int j = i - 1; j >= 0; j--) {
        if (c[j] != c[j + n - 1 - i]) {
          ok = 0;
          break;
        }
      }
      if (ok) same = i + 1;
    }
    cnt = max(cnt, same);
  }
  for (int i = 0; i < n; i++) cout << c[i];
  for (int j = 1; j < k; j++)
    for (int i = cnt; i < n; i++) cout << c[i];
  cout << endl;
}
