#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, mx = 0;
  cin >> n >> m;
  string s;
  cin >> s;
  set<char> st;
  if (n == 1) {
    while (m--) cout << s;
    return 0;
  }
  for (long long i = 0; i < n; i++) st.insert(s[i]);
  if (st.size() == 1) {
    cout << s;
    for (long long i = 1; i < m; i++) cout << s[0];
    return 0;
  }
  for (long long i = 1; i < n; i++) {
    string s1 = s.substr(0, i);
    string s2 = s.substr(n - i, i);
    if (s1.compare(s2) == 0) mx = i;
  }
  cout << s;
  m--;
  while (m--) {
    for (long long i = mx; i < n; i++) cout << s[i];
  }
}
