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;
char a[maxn];
map<char, int> mp;
vector<char> V, O;
int main() {
  mp.clear();
  V.clear();
  O.clear();
  int n;
  scanf("%d", &n);
  scanf("%s", a);
  for (int i = 0; i < n; i++) {
    if (mp.count(a[i]))
      mp[a[i]]++;
    else
      mp[a[i]] = 1;
  }
  int oddn = 0;
  for (__typeof((mp).begin()) i = (mp).begin(); i != (mp).end(); i++) {
    if ((i->second) & 1) oddn++, i->second--, O.push_back(i->first);
    for (int j = 0; j < i->second; j += 2) V.push_back(i->first);
  }
  int ans;
  for (ans = 1; ans <= n; ans++) {
    if (n % ans != 0) continue;
    int len = n / ans;
    if (len & 1) {
      if (oddn > ans) continue;
      int remain = ans - oddn;
      if (remain & 1) continue;
      break;
    } else {
      if (oddn) continue;
      break;
    }
  }
  vector<char> center;
  center.clear();
  printf("%d\n", ans);
  int len = n / ans;
  for (__typeof((O).begin()) i = (O).begin(); i != (O).end(); i++)
    center.push_back(*i);
  if (len & 1) {
    int remain = ans - oddn;
    while (remain) {
      center.push_back(V.back());
      center.push_back(V.back());
      V.pop_back();
      remain -= 2;
    }
    for (int i = 0; i < ans; i++) {
      string out;
      out.clear();
      for (int j = 0; j < len - 1; j += 2) {
        out.push_back(V.back());
        V.pop_back();
      }
      cout << out << center[i];
      reverse(out.begin(), out.end());
      cout << out;
      printf("%c", i == ans - 1 ? '\n' : ' ');
    }
  } else {
    for (int i = 0; i < ans; i++) {
      string out;
      out.clear();
      for (int j = 0; j < len; j += 2) {
        out.push_back(V.back());
        V.pop_back();
      }
      cout << out;
      reverse(out.begin(), out.end());
      cout << out;
      printf("%c", i == ans - 1 ? '\n' : ' ');
    }
  }
  return 0;
}