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 maxn = 400005;
string ans[maxn];
int v[maxn];
char aa[maxn];
int aasz, vsz;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int mp[2000] = {0};
  for (int i = 0; i < s.size(); ++i) mp[s[i]]++;
  int tab[2000] = {0};
  int tmp = 0;
  for (int i = 'a'; i <= 'z'; ++i) {
    if (mp[i] & 1) {
      mp[i]--;
      v[vsz++] = i;
    }
    if (mp[i] > 0) {
      aa[aasz++] = i;
      tab[i] += (mp[i] / 2);
      tmp += tab[i];
    }
  }
  for (int i = 'A'; i <= 'Z'; ++i) {
    if (mp[i] & 1) {
      mp[i]--;
      v[vsz++] = i;
    }
    if (mp[i] > 0) {
      aa[aasz++] = i;
      tab[i] += (mp[i] / 2);
      tmp += tab[i];
    }
  }
  for (int i = '0'; i <= '9'; ++i) {
    if (mp[i] & 1) {
      mp[i]--;
      v[vsz++] = i;
    }
    if (mp[i] > 0) {
      aa[aasz++] = i;
      tab[i] += (mp[i] / 2);
      tmp += tab[i];
    }
  }
  if (vsz <= 1) {
    puts("1");
    string ans = "";
    if (vsz == 1) ans += v[0];
    for (int i = 0; i < aasz; ++i) {
      char ch = aa[i];
      string bas = "";
      for (int j = 0; j < tab[ch]; ++j) bas += ch;
      ans += bas;
    }
    int sz = ans.size();
    for (int j = sz - 1; j >= 0; j--) putchar(ans[j]);
    for (int j = (s.size() & 1 ? 1 : 0); j < sz; j++) putchar(ans[j]);
    putchar('\n');
    return 0;
  }
  while (1) {
    int x = vsz;
    if (tmp % x == 0) {
      for (int i = vsz - 1; i >= 0; --i) {
        ans[i] = "";
        ans[i] += v[i];
        int t = tmp / x;
        while (t--) {
          char ch = aa[aasz - 1];
          tab[ch]--;
          if (tab[ch] == 0) aasz--;
          ans[i] += ch;
        }
      }
      break;
    }
    char ch = aa[aasz - 1];
    tab[ch]--, tmp--;
    if (tab[ch] == 0) aasz--;
    v[vsz++] = ch;
    v[vsz++] = ch;
  }
  printf("%d\n", vsz);
  for (int i = 0; i < vsz; ++i) {
    if (i > 0) putchar(' ');
    int sz = ans[i].size();
    for (int j = sz - 1; j >= 0; j--) putchar(ans[i][j]);
    for (int j = 1; j < sz; j++) putchar(ans[i][j]);
  }
  putchar('\n');
}