#include <bits/stdc++.h>
using namespace std;
int n;
const int maxN = 4 * 100000 + 10;
map<char, int> cnt;
char ch[maxN];
vector<char> odd, all;
void solve(int tedad) {
  int tul = n / tedad;
  cout << tedad << endl;
  for (int i = 1; i <= tedad; i++) {
    deque<char> s;
    if (!odd.empty()) {
      s.push_front(odd.back());
      odd.pop_back();
    } else {
      s.push_front(all.back());
      all.pop_back();
      if (!all.empty()) {
        odd.push_back(all.back());
        all.pop_back();
      }
    }
    for (int j = 2; j <= tul; j += 2) {
      s.push_front(all.back());
      all.pop_back();
      s.push_back(all.back());
      all.pop_back();
    }
    for (int i = 0; i < s.size(); i++) cout << s[i];
    cout << " ";
  }
  cout << endl;
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> ch[i];
    cnt[ch[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[ch[i]] != 0) {
      if (cnt[ch[i]] % 2) {
        odd.push_back(ch[i]);
        cnt[ch[i]]--;
      }
      for (int j = 1; j <= cnt[ch[i]]; j++) all.push_back(ch[i]);
      cnt[ch[i]] = 0;
    }
  }
  if (odd.size() == 0) {
    cout << 1 << endl;
    deque<char> s;
    for (int j = 1; j <= n; j += 2) {
      s.push_front(all.back());
      all.pop_back();
      s.push_back(all.back());
      all.pop_back();
    }
    for (int i = 0; i < s.size(); i++) cout << s[i];
    cout << " ";
    return 0;
  }
  for (int i = (int)odd.size(); i <= n; i++) {
    if (n % i == 0 && (n / i) % 2 == 1 && (i - odd.size()) % 2 == 0) {
      solve(i);
    }
  }
  return 0;
}
