#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    q;
vector<int> v;
int main() {
  int n, m;
  cin >> n >> m;
  string s, second, xx, yy;
  cin >> s;
  second = s;
  for (int i = 1; i < int(s.size()); i++) {
    xx = s.substr(i, n - 1);
    yy = s.substr(0, n - i);
    if (xx == yy) {
      second = s.substr(int(yy.size()), n - 1);
      break;
    }
  }
  cout << s;
  for (int i = 2; i <= m; i++) cout << second;
  cout << endl;
}
