#include <bits/stdc++.h>
using namespace std;
char f(int p) {
  if (p < 26)
    return p + 'a';
  else if (p < 52)
    return p - 26 + 'A';
  else
    return p - 52 + '0';
}
bool hlp(int x, vector<int> frq, int n) {
  int tmp = n / x;
  int p = (x / 2) * tmp, o = 0;
  if (x & 1) {
    o = tmp;
    for (int i = 0; i < 62; ++i) {
      if (p >= frq[i] / 2) {
        p -= frq[i] / 2;
        o -= frq[i] % 2;
      } else {
        frq[i] -= 2 * p;
        p = 0;
        o -= frq[i];
      }
    }
  } else
    for (int i = 0; i < 62; ++i) p -= frq[i] / 2;
  return (p <= 0 && o <= 0);
}
vector<vector<char>> form(int x, vector<int> frq, int n) {
  int tmp = n / x, p = 0;
  vector<vector<char>> v(tmp, vector<char>(x + 1));
  for (int i = 0; i < tmp; ++i) {
    int s = 1, e = x;
    while (s < e) {
      while (frq[p] < 2) ++p;
      v[i][s] = v[i][e] = f(p);
      frq[p] -= 2;
      ++s;
      --e;
    }
  }
  p = 0;
  if (x & 1) {
    for (int i = 0; i < tmp; ++i) {
      while (!frq[p]) ++p;
      v[i][x / 2 + 1] = f(p);
      --frq[p];
    }
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, i, j;
  cin >> n;
  char c;
  vector<int> fac, alph(62);
  for (i = 1; i <= sqrt(n); ++i)
    if (n % i == 0) fac.push_back(i), fac.push_back(n / i);
  for (i = 0; i < n; ++i) {
    cin >> c;
    if (c <= 'z' && c >= 'a')
      ++alph[c - 'a'];
    else if (c <= 'Z' && c >= 'A')
      ++alph[c - 'A' + 26];
    else
      ++alph[c - '0' + 52];
  }
  sort(fac.begin(), fac.end(), greater<int>());
  for (i = 0; i < fac.size(); ++i)
    if (hlp(fac[i], alph, n)) break;
  vector<vector<char>> v = form(fac[i], alph, n);
  cout << n / fac[i] << '\n';
  for (i = 0; i < v.size(); ++i, cout << " ")
    for (j = 1; j < v[i].size(); ++j) cout << v[i][j];
}
