#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  int n, k;
  cin >> n >> k;
  string str;
  cin >> str;
  int cc = 0;
  for (int i = 1; i < n; ++i) {
    auto p = str.substr(i, n - i);
    auto o = str.substr(0, n - i);
    if (o == p) {
      cc = i;
      break;
    }
  }
  if (cc == 0) {
    while (k--) cout << str;
  } else {
    --k;
    cout << str;
    auto u = str.substr(n - cc, cc);
    while (k--) cout << u;
  }
}
