#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n, l, k;
char a[1000005], s[1005][1005];
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n >> l >> k;
  for (int i = 1; i <= n * l; i++) cin >> a[i];
  sort(a + 1, a + n * l + 1);
  int t = 1;
  int f = 1;
  for (int i = 1; i <= l; i++) {
    for (int j = t; j <= k; j++) s[j][i] = a[f], f++;
    t = k;
    while (t > 1 && s[t - 1][i] == s[k][i]) t--;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= l; j++) {
      if (!s[i][j]) s[i][j] = a[f], f++;
      cout << s[i][j];
    }
    cout << '\n';
  }
}
