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;
int n;
char s[411111];
struct node {
  char ch;
  int num;
  node() {}
  node(char ch, int num) {
    this->ch = ch;
    this->num = num;
  }
} a[411111];
int tot = 0;
map<char, int> mp;
map<char, int>::iterator it;
vector<node> ans[411111];
int main(void) {
  scanf("%d", &n);
  scanf("%s", s);
  mp.clear();
  for (int i = 0; i < n; i++) {
    mp[s[i]]++;
  }
  int tot = 0;
  for (it = mp.begin(); it != mp.end(); it++) {
    if ((it->second) % 2 == 1) {
      ans[tot].push_back(node(it->first, 1));
      it->second--;
      tot++;
    }
  }
  if (tot == 0) {
    printf("1\n");
    vector<char> v;
    v.clear();
    for (it = mp.begin(); it != mp.end(); it++) {
      for (int j = 0; j < it->second / 2; j++) {
        v.push_back(it->first);
      }
    }
    for (it = mp.begin(); it != mp.end(); it++) {
      for (int j = 0; j < it->second / 2; j++) {
        printf("%c", it->first);
      }
    }
    for (int i = v.size() - 1; i >= 0; i--) {
      printf("%c", v[i]);
    }
    printf("\n");
    return 0;
  }
  while (!((n - tot) % tot == 0 && n % tot == 0 && (n / tot - 1) % 2 == 0)) {
    for (it = mp.begin(); it != mp.end(); it++) {
      if ((it->second) % 2 == 0 && it->second > 0) {
        ans[tot].push_back(node(it->first, 1));
        tot++;
        ans[tot].push_back(node(it->first, 1));
        tot++;
        it->second -= 2;
        if ((n - tot) % tot == 0 && n % tot == 0 && (n / tot - 1) % 2 == 0)
          break;
      }
    }
    if ((n - tot) % tot == 0 && n % tot == 0 && (n / tot - 1) % 2 == 0) break;
  }
  int len = n / tot;
  for (int i = 0; i < tot; i++) {
    int cnt = 0;
    while (1) {
      for (it = mp.begin(); it != mp.end(); it++) {
        if ((it->second) % 2 == 0 && it->second >= 2) {
          ans[i].push_back(node(it->first, 2));
          it->second -= 2;
          cnt += 2;
          if (cnt == len - 1) break;
        }
      }
      if (cnt == len - 1) break;
    }
  }
  printf("%d\n", tot);
  for (int i = 0; i < tot; i++) {
    vector<char> v;
    v.clear();
    for (int j = 0; j < ans[i].size(); j++) {
      for (int k = 0; k < ans[i][j].num / 2; k++) {
        v.push_back(ans[i][j].ch);
      }
    }
    for (int j = v.size() - 1; j >= 0; j--) {
      printf("%c", v[j]);
    }
    printf("%c", ans[i][0].ch);
    for (int j = 0; j < ans[i].size(); j++) {
      for (int k = 0; k < ans[i][j].num / 2; k++) {
        printf("%c", ans[i][j].ch);
      }
    }
    printf(" ");
  }
  printf("\n");
  return 0;
}