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 MX = 5e5 + 10;
int cnt[1000], temp_cnt[1000];
struct code {
  int x, y;
};
bool comp(int a, int b) { return a < b; }
bool is_pal(int a, int b) { return a % 10 == (b / 10) and a / 10 == b % 10; }
vector<int> ans;
vector<pair<int, int> > result[MX];
void print(int part, int odd) {
  odd++;
  cout << part << endl;
  for (int j = 1; j <= part; j++) {
    if (j != 1) cout << " ";
    for (int k = 0; k < result[j].size(); k++) {
      int letter = result[j][k].first;
      int cnt_letter = result[j][k].second;
      while (cnt_letter--) {
        cout << char(letter);
      }
    }
    for (int k = result[j].size() - odd; k >= 0; k--) {
      int letter = result[j][k].first;
      int cnt_letter = result[j][k].second;
      while (cnt_letter--) {
        cout << char(letter);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    cnt[s[i]]++;
  }
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ans.push_back(i);
      ans.push_back(n / i);
    }
  }
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) {
    int num = ans[i];
    for (int j = 0; j < 255; j++) {
      temp_cnt[j] = cnt[j];
      if (num % 2 == 0 and cnt[j] % 2 == 1) {
        num = 0;
        break;
      }
    }
    if (num == 0) continue;
    int part = n / num;
    if (num % 2 == 1) {
      int is_ans = 1;
      for (int j = 1; j <= part; j++) {
        int need = num;
        for (int k = 0; k <= 255 and need > 1; k++) {
          if (temp_cnt[k] <= need - 1 and temp_cnt[k]) {
            need -= (temp_cnt[k] - temp_cnt[k] % 2);
            result[j].push_back(make_pair(k, temp_cnt[k] / 2));
            temp_cnt[k] = temp_cnt[k] % 2;
          } else if (temp_cnt[k]) {
            temp_cnt[k] -= (need - 1);
            result[j].push_back(make_pair(k, (need - 1) / 2));
            need = 1;
          }
        }
        for (int k = 0; k < 255; k++) {
          if (temp_cnt[k] % 2) {
            need--;
            temp_cnt[k]--;
            result[j].push_back(make_pair(k, 1));
            break;
          }
        }
        for (int k = 0; k < 255 and need > 0; k++) {
          if (temp_cnt[k]) {
            need--;
            temp_cnt[k]--;
            result[j].push_back(make_pair(k, 1));
            break;
          }
        }
        if (need != 0) {
          for (int k = 1; k <= part; k++) {
            result[k].clear();
          }
          is_ans = 0;
          break;
        }
      }
      if (is_ans == 1) {
        print(part, 1);
        return 0;
      }
    } else {
      int is_ans = 1;
      for (int j = 1; j <= part; j++) {
        int need = num;
        for (int k = 0; k < 255 and need > 0; k++) {
          if (temp_cnt[k] <= need and temp_cnt[k]) {
            need -= temp_cnt[k];
            result[j].push_back(make_pair(k, temp_cnt[k] / 2));
          } else if (temp_cnt[k]) {
            temp_cnt[k] -= need;
            result[j].push_back(make_pair(k, need / 2));
            need = 0;
          }
        }
        if (need != 0) {
          for (int k = 1; k <= part; k++) {
            result[k].clear();
          }
          is_ans = 0;
          break;
        }
        if (is_ans == 1) {
          print(part, 0);
          return 0;
        }
      }
    }
  }
}