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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class m {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String s = br.readLine();
        int[] upper = new int[26];
        int[] lower = new int[26];
        int[] digits = new int[10];
        for (int i = 0; i < s.length(); i++) {
            if (Character.isDigit(s.charAt(i)))
                digits[s.charAt(i) - '0']++;
            else if (Character.isUpperCase(s.charAt(i)))
                upper[s.charAt(i) - 'A']++;
            else
                lower[s.charAt(i) - 'a']++;
        }
        int odd = 0;
        int even = 0;
        for (int i = 0; i < 26; i++) {
            if (upper[i] % 2 == 1)
                odd++;
            if (lower[i] % 2 == 1)
                odd++;
            even += (lower[i] / 2 + upper[i] / 2) * 2;
        }
        for (int i = 0; i < 10; i++) {
            if (digits[i] % 2 == 1)
                odd++;
            even += (digits[i] / 2) * 2;
        }
        int z;
        int x = 0;
        for (z = 1; z <= n; z++)
            if (n % z == 0 && (n / z - 1) % 2 == 0 && n - z <= even) {
                x = (n / z - 1) / 2;
                break;
            }
        if (even == n) {
            z = 1;
            x = n / 2;
        }
        PrintWriter out = new PrintWriter(System.out);

        out.println(z);
        for (int j = 0; j < z; j++) {
            StringBuilder st = new StringBuilder();
            StringBuilder end = new StringBuilder();
            boolean done = false;
            for (int i = 0; i < 26; i++)
                if (upper[i] % 2 == 1 || (z == n && upper[i] != 0)) {
                    end.append((char) (i + 'A'));
                    upper[i] -= 1;
                    done = true;
                    break;
                }
            for (int i = 0; i < 26 && !done; i++)
                if (lower[i] % 2 == 1 || (z == n && lower[i] != 0)) {
                    end.append((char) (i + 'a'));
                    lower[i] -= 1;
                    done = true;
                    break;
                }
            for (int i = 0; i < 10 && !done; i++)
                if (digits[i] % 2 == 1 || (z == n && digits[i] != 0)) {
                    end.append((char) (i + '0'));
                    digits[i] -= 1;
                    done = true;
                    break;
                }

            for (int i = 0; i < 26 && st.length() + end.length() <= n / z - 2; i++) {
                while (upper[i] > 1 && st.length() + end.length() <= n / z - 2) {
                    upper[i] -= 2;
                    st.append((char) (i + 'A'));
                    end.append((char) (i + 'A'));
                }
            }
            for (int i = 0; i < 26 && st.length() + end.length() <= n / z - 2; i++) {
                while (lower[i] > 1 && st.length() + end.length() <= n / z - 2) {
                    lower[i] -= 2;
                    st.append((char) (i + 'a'));
                    end.append((char) (i + 'a'));
                }
            }
            for (int i = 0; i < 10 && st.length() + end.length() <= n / z - 2; i++) {
                while (digits[i] > 1 && st.length() + end.length() <= n / z - 2) {
                    digits[i] -= 2;
                    st.append((char) (i + '0'));
                    end.append((char) (i + '0'));
                }
            }

            if (st.length() + end.length() < n / z) {
                done = false;
                for (int i = 0; i < 26; i++)
                    if (upper[i] > 0) {
                        end = new StringBuilder((char) (i + 'A') + "").append(end);
                        upper[i] -= 1;
                        done = true;
                        break;
                    }
                for (int i = 0; i < 26 && !done; i++)
                    if (lower[i] > 0) {
                        end = new StringBuilder((char) (i + 'a') + "").append(end);
                        lower[i] -= 1;
                        done = true;
                        break;
                    }
                for (int i = 0; i < 10 && !done; i++)
                    if (digits[i] > 0) {
                        end = new StringBuilder((char) (i + '0') + "").append(end);
                        digits[i] -= 1;
                        done = true;
                        break;
                    }
            }

            out.println(((st.reverse()).append(end)).toString());
        }
        out.flush();
        out.close();
    }

}