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 main() {
  int n;
  scanf("%d", &n);
  char a[n + 1];
  cin >> a;
  int small[26] = {0}, capi[26] = {0}, digit[10] = {0};
  for (int i = 0; i < n; i++) {
    if (a[i] >= '0' && a[i] <= '9') {
      digit[a[i] - '0']++;
    } else if (a[i] >= 'a' && a[i] <= 'z') {
      small[a[i] - 'a']++;
    } else {
      capi[a[i] - 'A']++;
    }
  }
  vector<char> ele;
  int count = 0, len = 0;
  for (int i = 0; i < 10; i++) {
    if (digit[i] % 2 == 1) {
      ele.push_back('0' + i);
      count++;
      digit[i]--;
    }
    len += digit[i];
  }
  for (int i = 0; i < 26; i++) {
    if (small[i] % 2 == 1) {
      small[i]--;
      ele.push_back('a' + i);
      count++;
    }
    len += small[i];
    if (capi[i] % 2 == 1) {
      capi[i]--;
      ele.push_back('A' + i);
      count++;
    }
    len += capi[i];
  }
  if (count == 0) {
    cout << 1 << endl;
    char arr[len + 1];
    arr[len] = '\0';
    int k = 0;
    for (int i = 0; i < 10; i++) {
      while (digit[i] > 0) {
        digit[i] -= 2;
        arr[k] = arr[len - k - 1] = i + '0';
        k++;
      }
    }
    for (int i = 0; i < 26; i++) {
      while (small[i] > 0) {
        small[i] -= 2;
        arr[k] = arr[len - k - 1] = i + 'a';
        k++;
      }
    }
    for (int i = 0; i < 26; i++) {
      while (capi[i] > 0) {
        capi[i] -= 2;
        arr[k] = arr[len - k - 1] = i + 'A';
        k++;
      }
    }
    cout << arr;
    return 0;
  } else {
    int extra = 0;
    while (19) {
      if (len <= 0) {
        break;
      }
      if (len % count == 0 && (len / count) % 2 == 0) {
        break;
      }
      len -= 2;
      extra += 2;
      count += 2;
    }
    if (len == 0) {
      cout << n << endl;
      for (int i = 0; i < n; i++) cout << a[i] << " ";
      return 0;
    } else {
      for (int i = 0; extra > 0 && i < 10; i++) {
        while (extra > 0 && digit[i] > 0) {
          digit[i]--;
          extra--;
          ele.push_back('0' + i);
        }
      }
      for (int i = 0; i < 26 && count > 0; i++) {
        while (extra > 0 && small[i] > 0) {
          small[i]--;
          extra--;
          ele.push_back('a' + i);
        }
      }
      for (int i = 0; i < 26 && count > 0; i++) {
        while (extra > 0 && capi[i] > 0) {
          capi[i]--;
          extra--;
          ele.push_back('A' + i);
        }
      }
    }
  }
  cout << count << endl;
  char ch;
  int i, j, d = 0, s = 0, c = 0;
  len /= count;
  char arr[len + 2];
  while (count != 0 && !ele.empty()) {
    count--;
    char ch = ele[ele.size() - 1];
    ele.pop_back();
    arr[len / 2] = ch;
    i = 0;
    while (i < len / 2 && d < 10) {
      while (d < 10 && digit[d] == 0) d++;
      while (d < 10 && i < len / 2 && digit[d] > 0) {
        arr[i] = arr[len - i] = d + '0';
        digit[d] -= 2;
        i++;
      }
    }
    while (i < len / 2 && s < 26) {
      while (s < 26 && small[s] == 0) s++;
      while (s < 26 && i < len / 2 && small[s] > 0) {
        arr[i] = arr[len - i] = s + 'a';
        small[s] -= 2;
        i++;
      }
    }
    while (i < len / 2 && c < 26) {
      while (c < 26 && capi[c] == 0) c++;
      while (c < 26 && i < len / 2 && capi[c] > 0) {
        arr[i] = arr[len - i] = c + 'A';
        capi[c] -= 2;
        i++;
      }
    }
    arr[len + 1] = '\0';
    printf("%s ", arr);
  }
  return 0;
}