#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& c, pair<T1, T2>& v) {
  c << "(" << v.first << "," << v.second << ")";
  return c;
}
template <template <class...> class TT, class... T>
ostream& operator<<(ostream& out, TT<T...>& c) {
  out << "{ ";
  for (auto& x : c) out << x << " ";
  out << "}";
  return out;
}
const int LIM = 1e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y, w;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  vector<char> v;
  char c;
  for (int i = 0; i < n * m; ++i) cin >> c, v.push_back(c);
  sort(v.begin(), v.end());
  int lf = 0, rt = n * m - 1;
  string p[n];
  for (int i = 0; i < n; ++i) p[i] = string(m, '0');
  int e = k;
  for (int i = 0; i < m; ++i) {
    rt -= (k - e);
    for (int j = 0; j < k - e; ++j) {
      p[j][i] = v[rt + 1 + j];
    }
    int ne = 0;
    char pre = 0;
    for (int j = 0; j < e; ++j) {
      p[k - e + j][i] = v[lf];
      if (v[lf] == pre)
        ne++;
      else
        ne = 1;
      pre = v[lf];
      ++lf;
    }
    e = ne;
  }
  for (int i = k; i < n; ++i)
    for (int j = 0; j < m; ++j) p[i][j] = v[lf], lf++;
  for (int i = 0; i < n; ++i) cout << p[i].c_str() << '\n';
  return 0;
}
