#include <bits/stdc++.h>
using namespace std;
char arr[1002][1002];
int vis[1002][1002], pp = 0, len;
string s;
void func(int in, int l, int r) {
  if (in == len) return;
  for (int i = l; i <= r; i++) {
    vis[i][in] = 1;
    arr[i][in] = s[pp++];
  }
  int k = r;
  while (k >= l && arr[k][in] == arr[r][in]) k--;
  func(in + 1, k + 1, r);
}
int main() {
  int n, k, i, j;
  cin >> n >> len >> k;
  cin >> s;
  sort(s.begin(), s.end());
  func(0, 0, k - 1);
  for (i = 0; i < len; i++)
    for (j = 0; j < n; j++)
      if (!vis[j][i]) arr[j][i] = s[pp++];
  for (i = 0; i < n; i++) {
    for (j = 0; j < len; j++) cout << arr[i][j];
    cout << endl;
  }
  return 0;
}
