#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, l;
  cin >> n >> l >> k;
  k--;
  deque<int> c;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (char a : s) c.push_back(a - 'a');
  }
  sort(begin(c), end(c));
  int board[n][l];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < l; j++) board[i][j] = -1;
  int L = 0, R = n - 1;
  for (int j = 0; j < l; j++) {
    for (int i = L; i <= k; i++) {
      board[i][j] = c.front();
      c.pop_front();
    }
    for (int i = R; i > k; i--) {
      board[i][j] = c.back();
      c.pop_back();
    }
    L = R = k;
    while (L > 0 && board[L - 1][j] == board[k][j]) L--;
    while (R < n - 1 && board[R + 1][j] == board[k][j]) R++;
  }
  stringstream ss;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < l; j++) {
      if (board[i][j] == -1) {
        ss << char('a' + c.front());
        c.pop_front();
      } else
        ss << char('a' + board[i][j]);
    }
    ss << endl;
  }
  cout << ss.str();
  return 0;
}
