#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string L = "", R = "";
  int l = 0, r = s.size() - 1, c = 0;
  while (r > 0) {
    L += s[l];
    R = s[r] + R;
    if (L == R) c = L.size();
    l++;
    r--;
  }
  cout << s;
  k--;
  s.erase(0, c);
  while (k--) cout << s;
}
