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;
map<char, int> counts;
vector<list<char> > palindromes;
string s;
int numberOfOdds = 0;
void print() {
  for (int i = 0; i < palindromes.size(); ++i) {
    for (auto& currentChar : palindromes[i]) {
      cout << currentChar;
    }
    cout << " ";
  }
}
void fit(int groups) {
  for (auto it = counts.cbegin(); it != counts.cend();) {
    auto next = it;
    ++next;
    char currentChar = it->first;
    int charCount = it->second;
    if (charCount % 2 != 0) {
      list<char> newlist;
      newlist.push_front(currentChar);
      counts[currentChar] -= 1;
      palindromes.push_back(newlist);
      if (counts[currentChar] == 0) {
        next = counts.erase(it);
      }
    }
    it = next;
  }
  int diff = groups - numberOfOdds;
  while (diff > 0) {
    for (auto it = counts.cbegin(); it != counts.cend();) {
      auto next = it;
      ++next;
      char currentChar = it->first;
      int charCount = it->second;
      if (charCount >= 2) {
        diff -= 2;
        list<char> newlist;
        newlist.push_front(currentChar);
        counts[currentChar] -= 2;
        if (counts[currentChar] == 0) {
          next = counts.erase(it);
        }
        palindromes.push_back(newlist);
        palindromes.push_back(newlist);
        break;
      }
      it = next;
    }
  }
  for (auto& mapEntry : counts) {
    char currentChar = mapEntry.first;
    int charCount = mapEntry.second;
  }
  int inserted = groups;
  while (inserted != s.size()) {
    for (int i = 0; i < palindromes.size(); ++i) {
      for (auto it = counts.cbegin(); it != counts.cend();) {
        auto next = it;
        ++next;
        char currentChar = it->first;
        int charCount = it->second;
        if (charCount >= 2) {
          inserted += 2;
          palindromes[i].push_front(currentChar);
          palindromes[i].push_back(currentChar);
          counts[currentChar] -= 2;
          if (counts[currentChar] == 0) {
            next = counts.erase(it);
          }
          break;
        }
        it = next;
      }
    }
  }
  cout << groups << endl;
  print();
}
void special() {
  list<char> pal;
  for (auto it = counts.cbegin(); it != counts.cend();) {
    auto next = it;
    ++next;
    char currentChar = it->first;
    int charCount = it->second;
    int to_insert = charCount / 2;
    for (int i = 0; i < to_insert; ++i) {
      pal.push_front(currentChar);
      pal.push_back(currentChar);
    }
    it = next;
  }
  palindromes.push_back(pal);
  cout << 1 << endl;
  print();
}
void solve() {
  for (int i = 0; i < s.size(); ++i) {
    char currentChar = s[i];
    if (counts.find(currentChar) == counts.end()) counts[currentChar] = 0;
    counts[currentChar] += 1;
  }
  for (auto& mapEntry : counts) {
    int count = mapEntry.second;
    if (count % 2 != 0) ++numberOfOdds;
  }
  if (numberOfOdds == 0) {
    special();
    return;
  }
  for (int i = numberOfOdds; i <= s.size(); ++i) {
    if (s.size() % i != 0) continue;
    if ((s.size() / i) % 2 == 0) continue;
    int diff = i - numberOfOdds;
    if (diff % 2 == 0) {
      fit(i);
      return;
    }
  }
}
int main() {
  int n = 40;
  srand(time(NULL));
  for (int i = 0; i < n; ++i) {
    char ran = (rand() % 26) + 'a';
    s.push_back(ran);
  }
  cin >> n;
  cin >> s;
  solve();
  return 0;
}