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>
template <typename Tp>
void in(Tp &x) {
  char ch = getchar(), f = 1;
  x = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
template <typename Tp>
bool chkmax(Tp &x, Tp y) {
  return x >= y ? 0 : (x = y, 1);
}
template <typename Tp>
bool chkmin(Tp &x, Tp y) {
  return x <= y ? 0 : (x = y, 1);
}
template <typename Tp>
Tp Max(const Tp &x, const Tp &y) {
  return x > y ? x : y;
}
template <typename Tp>
Tp Min(const Tp &x, const Tp &y) {
  return x < y ? x : y;
}
const int MAXN = 1000010;
int n, tot[MAXN];
char str[MAXN];
int to[MAXN], re[MAXN];
int sss[MAXN];
int remain[MAXN], re2[MAXN];
int main() {
  in(n);
  scanf("%s", str + 1);
  for (int i = ('a'), i_END_ = ('z'); i <= i_END_; ++i)
    to[i] = ++to[0], re[to[0]] = i;
  for (int i = ('A'), i_END_ = ('Z'); i <= i_END_; ++i)
    to[i] = ++to[0], re[to[0]] = i;
  for (int i = ('0'), i_END_ = ('9'); i <= i_END_; ++i)
    to[i] = ++to[0], re[to[0]] = i;
  for (int i = (1), i_END_ = (n); i <= i_END_; ++i) {
    tot[to[str[i]]]++;
  }
  bool flag1 = false, flag2 = false;
  for (int i = (1), i_END_ = (70); i <= i_END_; ++i) {
    if (!tot[i]) continue;
    if (tot[i] >= 2) flag1 = true;
    if (tot[i] == 1) flag2 = true;
  }
  if (!flag1) {
    printf("%d\n", n);
    for (int i = (1), i_END_ = (n); i <= i_END_; ++i) printf("%c ", str[i]);
    return 0;
  }
  for (int i = (1), i_END_ = (n); i <= i_END_; ++i) {
    if (n % i != 0) continue;
    int len = n / i, can = 0;
    if (!(len & 1)) {
      bool fff = false;
      for (int j = (1), j_END_ = (70); j <= j_END_; ++j) {
        if (tot[j] % 2 != 0) {
          fff = true;
          break;
        }
      }
      if (fff) continue;
    }
    bool ff = false;
    for (int j = (1), j_END_ = (70); j <= j_END_; ++j) {
      can += tot[j] / 2;
      if (can >= (len / 2) * i) {
        ff = true;
        break;
      }
    }
    if (!ff) continue;
    can = 0;
    remain[0] = 0;
    printf("%d\n", i);
    for (int j = (1), j_END_ = (70); j <= j_END_; ++j) {
      can += tot[j] / 2;
      if (can >= (len / 2) * i) {
        for (int k = (1), k_END_ = ((len / 2) * i - (can - tot[j] / 2));
             k <= k_END_; ++k)
          remain[++remain[0]] = j;
        for (int k = (((len / 2) * i - (can - tot[j] / 2)) * 2 + 1),
                 k_END_ = (tot[j]);
             k <= k_END_; ++k)
          re2[++re2[0]] = j;
        for (int l = (j + 1), l_END_ = (70); l <= l_END_; ++l) {
          for (int zzzz = (1), zzzz_END_ = (tot[l]); zzzz <= zzzz_END_; ++zzzz)
            re2[++re2[0]] = l;
        }
        break;
      } else {
        for (int k = (1), k_END_ = (tot[j] / 2); k <= k_END_; ++k)
          remain[++remain[0]] = j;
        if (tot[j] % 2 == 1) re2[++re2[0]] = j;
      }
    }
    int front = 0, f2 = 0;
    for (int j = (1), j_END_ = (i); j <= j_END_; ++j) {
      if (!(len & 1)) {
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k)
          printf("%c", re[remain[++front]]);
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k)
          printf("%c", re[remain[front--]]);
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k) front++;
      } else {
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k)
          printf("%c", re[remain[++front]]);
        printf("%c", re[re2[++f2]]);
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k)
          printf("%c", re[remain[front--]]);
        for (int k = (1), k_END_ = (len / 2); k <= k_END_; ++k) front++;
      }
      putchar(' ');
    }
    break;
  }
  return 0;
}