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;
char str[500005];
int sum[500];
int ans[500005];
int od[128];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", str);
  int odd = 0;
  for (int i = 0; i < n; ++i) {
    sum[str[i]]++;
  }
  for (int i = 0; i < 128; ++i) {
    if (sum[i] % 2) odd++;
  }
  int i;
  for (i = n; i >= 1; --i) {
    if (n % i == 0) {
      if (i % 2) {
        if (n / i >= odd) break;
      } else if (odd == 0)
        break;
    }
  }
  printf("%d\n", n / i);
  int xx = i;
  if (xx % 2 == 0) {
    for (int i = 0; i < 128; ++i) sum[i] /= 2;
    int index = 0;
    int len;
    for (int i = 0; i < n / xx; ++i) {
      len = 0;
      for (int j = index; j < 128; ++j) {
        if (len + sum[j] > xx / 2) {
          sum[j] -= xx / 2 - len;
          for (; len < xx / 2; ++len) ans[len] = j;
        } else {
          for (int x = 0; len < xx / 2 && x < sum[j]; ++len, ++x) ans[len] = j;
          sum[j] = 0;
        }
      }
      for (int j = 0; j < xx / 2; ++j) printf("%c", char(ans[j]));
      for (int j = xx / 2 - 1; j >= 0; --j) printf("%c", char(ans[j]));
      printf(" ");
    }
  } else {
    int odnum = 0;
    int flag = 0;
    for (int i = 0; i < 128; ++i) {
      if (sum[i] % 2) od[odnum++] = i;
      sum[i] /= 2;
    }
    int index = 0;
    int len;
    for (int i = 0; i < n / xx; ++i) {
      len = 0;
      for (int j = index; j < 128; ++j) {
        if (len + sum[j] >= xx / 2) {
          sum[j] -= xx / 2 - len;
          for (; len < xx / 2; ++len) ans[len] = j;
          break;
        } else {
          for (int x = 0; x < sum[j]; ++len, ++x) ans[len] = j;
          sum[j] = 0;
        }
      }
      for (int j = 0; j < xx / 2; ++j) printf("%c", char(ans[j]));
      if (odnum > 0)
        printf("%c", char(od[--odnum]));
      else {
        for (int j = 128; j >= 0; --j) {
          if (sum[j] > 0) {
            printf("%c", char(j));
            if (flag == 1) {
              flag = 0;
              sum[j]--;
            } else {
              flag = 1;
            }
            break;
          }
        }
      }
      for (int j = xx / 2 - 1; j >= 0; --j) printf("%c", char(ans[j]));
      printf(" ");
    }
  }
  return 0;
}