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 = 400100;
int n, len = 0;
char sz[maxn];
char s1[maxn];
char s2[maxn];
int num[110];
int rk[110];
int main() {
  scanf("%d", &n);
  scanf("%s", sz + 1);
  for (int i = 1; i <= n; i++) {
    if (sz[i] >= 'a' && sz[i] <= 'z') {
      num[sz[i] - 'a' + 1]++;
    } else if (sz[i] >= 'A' && sz[i] <= 'Z') {
      num[sz[i] - 'A' + 27]++;
    } else {
      num[sz[i] - '0' + 53]++;
    }
  }
  int ans = 0, tans = 0;
  for (int i = 1; i <= 62; i++) {
    if (num[i] % 2 == 1) {
      if (i >= 1 && i <= 26)
        s1[++ans] = 'a' + (i - 1);
      else if (i >= 27 && i <= 52)
        s1[++ans] = 'A' + (i - 27);
      else
        s1[++ans] = '0' + (i - 53);
      num[i]--;
    }
  }
  for (int i = 1; i <= 62; i++) {
    for (int j = 1; j <= num[i]; j++) {
      if (i >= 1 && i <= 26)
        s2[++len] = 'a' + (i - 1);
      else if (i >= 27 && i <= 52)
        s2[++len] = 'A' + (i - 27);
      else
        s2[++len] = '0' + (i - 53);
    }
  }
  if (ans == 0) {
    printf("1\n");
    for (int i = 1; i <= len; i++) {
      if (i % 2 == 1) printf("%c", s2[i]);
    }
    for (int i = len; i >= 1; i--) {
      if (i % 2 == 0) printf("%c", s2[i]);
    }
    printf("\n");
    return 0;
  }
  if (ans == n) {
    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%c ", s1[i]);
    printf("\n");
    return 0;
  }
  for (int i = ans; i <= n; i++) {
    if (n % i == 0 && (n / i) % 2 == 1) {
      int need = (i - ans);
      if (need % 2 == 0) {
        printf("%d\n", i);
        int cnt = 0;
        for (int j = 1; j <= need; j++) s1[++ans] = s2[j];
        int f = (n / i) / 2;
        for (int j = need + 1; cnt < i;) {
          cnt++;
          for (int k = j; k <= j + (2 * f) - 1; k++) {
            if (k % 2 == 1) printf("%c", s2[k]);
          }
          printf("%c", s1[cnt]);
          for (int k = j + (2 * f) - 1; k >= j; k--) {
            if (k % 2 == 0) printf("%c", s2[k]);
          }
          printf(" ");
          j = j + (2 * f);
        }
        break;
      }
    }
  }
  return 0;
}