#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
void solve(istream& in, ostream& out) {
  int n, k;
  string t;
  in >> n >> k >> t;
  string l = "", r = "";
  vector<int> ind;
  for (int i = (0); i < (n); i++) {
    l += t[i];
    r = t[n - i - 1] + r;
    if (l == r) {
      ind.push_back(i);
    }
  }
  ind.pop_back();
  if (ind.size() == 0) {
    for (int i = (0); i < (k); i++) out << t;
    return;
  }
  int idx = *ind.rbegin();
  string tt = "";
  for (int i = (idx + 1); i < (n); i++) {
    tt += t[i];
  }
  out << t;
  for (int i = (0); i < (k - 1); i++) out << tt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve(cin, cout);
  return 0;
}
