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 N = 4e5 + 10;
int n;
char s[N];
int cnt[320];
void gao(int k) {
  cout << k << "\n";
  vector<string> pre(k, ""), mid(k, "");
  vector<char> DB;
  if ((n / k) % 2) {
    vector<char> single;
    for (int i = 1; i < 255; ++i) {
      if (cnt[i] & 1) {
        single.push_back(char(i));
        --cnt[i];
      }
    }
    for (int i = 1; i < 255; ++i) {
      while (cnt[i] > 0 && (int(single.size())) + 2 <= k) {
        cnt[i] -= 2;
        single.push_back(char(i));
        single.push_back(char(i));
      }
    }
    for (int i = 0; i < k; ++i) {
      mid[i] += single.back();
      single.pop_back();
    }
  }
  for (int i = 1; i < 255; ++i) {
    assert(cnt[i] % 2 == 0);
    while (cnt[i] >= 2) {
      cnt[i] -= 2;
      DB.push_back(char(i));
    }
  }
  for (int i = 0; i < k; ++i) {
    while ((int(pre[i].size())) * 2 + (int(mid[i].size())) + 2 <= n / k) {
      pre[i] += char(DB.back());
      DB.pop_back();
    }
  }
  for (int i = 0; i < k; ++i) {
    assert((int(pre[i].size())) + (int(mid[i].size())) + (int(pre[i].size())) ==
           n / k);
    if ((int(pre[i].size()))) cout << pre[i];
    if ((int(mid[i].size()))) cout << mid[i];
    if ((int(pre[i].size()))) {
      reverse(pre[i].begin(), pre[i].end());
      cout << pre[i];
    }
    cout << " \n"[i == k - 1];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  memset(cnt, 0, sizeof cnt);
  cin >> n >> (s + 1);
  for (int i = 1; i <= n; ++i) {
    assert(int(s[i]) <= 255);
    ++cnt[int(s[i])];
  }
  int a = 0;
  for (int i = 1; i < 255; ++i)
    if (cnt[i] & 1) ++a;
  for (int i = 1; i <= n; ++i)
    if (n % i == 0) {
      if (i == n) {
        gao(i);
        break;
      }
      if (a == 0 && (n / i) % 2 == 0) {
        gao(i);
        break;
      }
      if (a > 0 && i >= a && (i - a) % 2 == 0 && ((n / i) - 1) % 2 == 0) {
        gao(i);
        break;
      }
    }
  return 0;
}