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.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
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;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskH solver = new TaskH();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskH {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            String s = in.next();
            int[] cnt = new int[128];
            for (int i = 0; i < n; i++) {
                cnt[s.charAt(i)]++;
            }
            int oddCnt = 0;
            for (int i = 0; i < 128; i++) {
                if (cnt[i] % 2 == 1) oddCnt++;
            }
            ArrayList<Integer> qty = new ArrayList<>();
            for (int i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    qty.add(i);
                    if (n / i != i) {
                        qty.add(n / i);
                    }
                }
            }
            qty.sort(Integer::compareTo);
            for (int q : qty) {
                if ((q == 1 && oddCnt == n % 2)
                        || ((n / q) % 2 == 1 && q >= oddCnt && (q - oddCnt) % 2 == 0)
                        || ((n / q) % 2 == 0) && oddCnt == 0) {
                    out.println(q);
                    out.println(build(cnt, q, n));
                    return;
                }
            }
        }

        String build(int[] charCnt, int qty, int n) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < qty; i++) {
                sb.append(buildPal(charCnt, n / qty));
                if (i != qty - 1) sb.append(" ");
            }
            return sb.toString();
        }

        String buildPal(int[] charCnt, int len) {
            char[] ans = new char[len];
            if (len % 2 == 1) {
                for (int i = 0; i < 128; i++) {
                    if (charCnt[i] % 2 == 1) {
                        charCnt[i]--;
                        ans[len / 2] = (char) i;
                        break;
                    }
                }
                if (ans[len / 2] == 0) {
                    for (int i = 0; i < 128; i++) {
                        if (charCnt[i] > 0) {
                            charCnt[i]--;
                            ans[len / 2] = (char) i;
                            break;
                        }
                    }
                }
            }
            char ind = 0;
            for (int i = 0; i < len / 2; i++) {
                while (charCnt[ind] < 2) ind++;
                ans[i] = ind;
                ans[len - i - 1] = ind;
                charCnt[ind] -= 2;
            }
            return new String(ans);
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

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

    }
}