#include <bits/stdc++.h>
int N, K;
std::string S;
int main() {
  std::cin >> N >> K;
  std::cin >> S;
  std::string t = S;
  std::string s = "";
  for (int l = 1; l < N; ++l) {
    if (S.substr(0, l) == S.substr(N - l, l)) {
      t = S.substr(0, N - l);
      s = S.substr(N - l, l);
    }
  }
  while (K--) std::cout << t;
  std::cout << s << "\n";
  return 0;
}
