Problem: Kolya has a string s of length n consisting of lowercase and uppercase Latin letters and digits.

He wants to rearrange the symbols in s and cut it into the minimum number of parts so that each part is a palindrome and all parts have the same lengths. A palindrome is a string which reads the same backward as forward, such as madam or racecar.

Your task is to help Kolya and determine the minimum number of palindromes of equal lengths to cut s into, if it is allowed to rearrange letters in s before cuttings.

Input

The first line contains an integer n (1 ≤ n ≤ 4·105) — the length of string s.

The second line contains a string s of length n consisting of lowercase and uppercase Latin letters and digits.

Output

Print to the first line an integer k — minimum number of palindromes into which you can cut a given string.

Print to the second line k strings — the palindromes themselves. Separate them by a space. You are allowed to print palindromes in arbitrary order. All of them should have the same length.

Examples

Input

6
aabaac


Output

2
aba aca 

Input

8
0rTrT022


Output

1
02TrrT20 

Input

2
aA


Output

2
a A 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 123;
const long long LINF = (long long)2e18 + 123;
template <typename A, typename B>
bool mini(A &x, const B &y) {
  if (y < x) {
    x = y;
    return 1;
  }
  return 0;
}
void run();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  run();
  return 0;
}
int cnt[256];
int n;
string ans[400002];
bool f(int k) {
  int len = n / k;
  bool good = 1;
  if (len % 2 == 0) {
    for (int i = 0; i < 256; i++) {
      if (cnt[i] % 2 == 1) {
        return false;
      }
    }
    int ptr = 0;
    for (int i = 0; i < k; i++) {
      int j = 0;
      while (j < len / 2) {
        if (cnt[ptr] >= 2) {
          ++j;
          cnt[ptr] -= 2;
          ans[i].push_back(ptr);
        } else {
          ++ptr;
        }
      }
    }
  } else {
    int even_cnt = 0;
    for (int i = 0; i < 256; i++) even_cnt += cnt[i] / 2;
    if (len / 2 * k > even_cnt) {
      return false;
    }
    int ptr = 0;
    for (int i = 0; i < k; i++) {
      int j = 0;
      while (j < len / 2) {
        if (cnt[ptr] >= 2) {
          ++j;
          cnt[ptr] -= 2;
          ans[i].push_back(ptr);
        } else {
          ++ptr;
        }
      }
    }
    ptr = 0;
    for (int i = 0; i < k; i++) {
      while (cnt[ptr] == 0) {
        ++ptr;
      }
      cnt[ptr]--;
      ans[i].push_back(ptr);
    }
  }
  return true;
}
void run() {
  cin >> n;
  string s;
  cin >> s;
  vector<int> d;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      d.push_back(i);
      if (n / i != i) {
        d.push_back(n / i);
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    ++cnt[s[i]];
  }
  sort((d).begin(), (d).end());
  for (int i : d) {
    if (f(i)) {
      cout << i << "\n";
      int len = n / i;
      for (int j = 0; j < i; j++) {
        if (len % 2 == 0) {
          for (int t = 0; t < ((int)ans[j].size()); t++) {
            cout << ans[j][t];
          }
          for (int t = ((int)ans[j].size()) - 1; t >= 0; t--) {
            cout << ans[j][t];
          }
        } else {
          for (int t = 0; t < ((int)ans[j].size()) - 1; t++) {
            cout << ans[j][t];
          }
          cout << ans[j].back();
          for (int t = ((int)ans[j].size()) - 2; t >= 0; t--) {
            cout << ans[j][t];
          }
        }
        cout << " ";
      }
      return;
    }
  }
}