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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.util.AbstractCollection;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        HPalindromicCut solver = new HPalindromicCut();
        solver.solve(1, in, out);
        out.close();
    }

    static class HPalindromicCut {
        int n;
        char[] arr;
        int[] count;

        public void readInput(Scanner sc) {
            n = sc.nextInt();
            arr = sc.next().toCharArray();
        }

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int q = 1;
            while (q-- > 0) {
                readInput(sc);
                TreeMap<Character, Integer> map = new TreeMap<>();
                for (char c : arr)
                    map.put(c, map.getOrDefault(c, 0) + 1);
                count = new int[2];
                for (int x : map.values()) {
                    count[0] += x / 2;
                    if (x % 2 == 1)
                        count[1]++;
                }
                TreeMap<Character, Integer> even = new TreeMap<>(), odd = new TreeMap<>();
                for (Map.Entry<Character, Integer> entry : map.entrySet()) {
                    int val = entry.getValue();
                    char c = entry.getKey();
                    if (val / 2 > 0)
                        even.put(c, val / 2);
                    if (val % 2 == 1)
                        odd.put(c, 1);
                }
                int max = 0;
                for (int i = 1; i * i <= n; i++) {
                    if (n % i == 0) {
                        if (valid(i)) {
                            max = Math.max(max, i);
                        }
                        if (valid(n / i)) {
                            max = Math.max(max, n / i);
                        }
                    }
                }
                pw.println(n / max);
                for (int i = 0; i < n / max; i++) {
                    LinkedList<Character> list = new LinkedList<>();
                    int ev = max / 2;
                    count[0] -= ev;
                    int od = max % 2;
                    if (count[1] < od) {
                        count[1] += 2;
                        count[0]--;
                        char c = even.firstKey();
                        even.put(c, even.get(c) - 1);
                        if (even.get(c) == 0)
                            even.remove(c);
                        odd.put(c, odd.getOrDefault(c, 0) + 2);
                    }
                    if (od == 1) {
                        char c = odd.firstKey();
                        odd.put(c, odd.get(c) - 1);
                        if (odd.get(c) == 0)
                            odd.remove(c);
                        list.addFirst(c);
                        count[1]--;
                    }
                    while (ev > 0) {
                        char c = even.firstKey();
                        even.put(c, even.get(c) - 1);
                        if (even.get(c) == 0)
                            even.remove(c);
                        list.addFirst(c);
                        list.addLast(c);
                        ev--;
                    }
                    StringBuilder sb = new StringBuilder();
                    while (!list.isEmpty())
                        sb.append(list.pollFirst());
                    pw.print(sb.toString() + " ");
                }
            }
        }

        private boolean valid(int div) {
            int[] temp = count.clone();
            for (int i = 0; i < n / div; i++) {
                int even = div / 2;
                temp[0] -= even;
                int odd = div % 2;
                if (temp[1] < odd) {
                    temp[1] += 2;
                    temp[0]--;
                }
                temp[1] -= odd;
            }
            return temp[0] == 0 && temp[1] == 0;
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            try {
                while (st == null || !st.hasMoreTokens())
                    st = new StringTokenizer(br.readLine());
                return st.nextToken();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}