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 = int(1e5) + 10;
const int MOD = int(1e9) + 7;
const int oo = INT_MAX;
int n;
string str;
int cnt[255];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> n >> str) {
    memset(cnt, 0, sizeof(cnt));
    for (auto& e : str) {
      cnt[e]++;
    }
    int odd = 0;
    for (int i = 0; i < 255; ++i) {
      if (cnt[i] & 1) {
        odd++;
      }
    }
    if (odd == 0) {
      cout << 1 << '\n';
      deque<char> dq;
      for (int i = 0; i < 255; ++i) {
        int x = cnt[i] / 2;
        while (x--) {
          dq.push_back(i);
          dq.push_front(i);
        }
      }
      cout << string((dq).begin(), (dq).end()) << '\n';
      continue;
    }
    int ans = 1, k = 0;
    for (int i = 1; i <= n; i += 2) {
      if (n % i == 0) {
        int x = n - odd * i, y = 2 * i;
        if (x >= 0 && x % y == 0) {
          int ck = x / y;
          if ((odd + 2 * ck) * i == n) {
            ans = i;
            k = ck;
          }
        }
      }
    }
    cout << n / ans << '\n';
    queue<char> center;
    for (int i = 0; i < 255; ++i) {
      if (cnt[i] & 1) {
        center.push(i);
        cnt[i]--;
      }
    }
    for (int i = 0; i < 255; ++i) {
      while (cnt[i] && k) {
        center.push(i);
        center.push(i);
        k--;
        cnt[i] -= 2;
      }
    }
    bool fst = true;
    string l = "";
    for (int i = 0; !center.empty() && i < 255;) {
      if (int((l).size()) * 2 + 1 == ans) {
        if (!fst) cout << ' ';
        fst = false;
        cout << l;
        cout << center.front();
        center.pop();
        reverse((l).begin(), (l).end());
        cout << l;
        l = "";
        continue;
      }
      if (cnt[i] == 0) {
        i++;
        continue;
      }
      l.push_back(i);
      cnt[i] -= 2;
    }
    cout << '\n';
  }
  return 0;
}