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