#include <bits/stdc++.h>
using namespace std;
void use_cio() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
template <typename... Args>
void dbg(Args... args) {
  ((cout << args << " "), ...);
  cout << endl;
}
int n, k;
string s;
int main() {
  use_cio();
  cin >> n >> k;
  cin >> s;
  int cut = 0;
  for (cut = n - 1; cut >= 0; cut--) {
    if (s.substr(0, cut) == s.substr(n - cut, cut)) break;
  }
  cout << s;
  for (int i = 0; i < (k - 1); i++) cout << s.substr(cut, n - cut);
}
