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.PriorityQueue;
import java.io.StringWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            char[] s = in.nextCharacterArray(n);
            int[] ct = StringUtils.countAll(s);
            int sum = 0;
            PriorityQueue<Integer> odd = new PriorityQueue<>(new Comparator<Integer>() {

                public int compare(Integer o1, Integer o2) {
                    return Integer.compare(ct[o2], ct[o1]);
                }
            });
            PriorityQueue<Integer> even = new PriorityQueue<>(new Comparator<Integer>() {

                public int compare(Integer o1, Integer o2) {
                    return Integer.compare(ct[o2], ct[o1]);
                }
            });
            for (int i = 0; i < 128; ++i) {
                if (ct[i] == 0) continue;
                if (ct[i] % 2 == 0) {
                    even.add(i);
                } else {
                    odd.add(i);
                }
                sum += ct[i];
            }
            int oddcount = odd.size();
            String ans = null;
            if (oddcount == 0) {
                out.println(solveForThis(odd, even, ct, 1, sum));
                return;
            }
            for (int i = oddcount; i <= sum; ++i) {
                if (sum % i == 0) {
                    odd.clear();
                    even.clear();
                    for (int j = 0; j < 128; ++j) {
                        if (ct[j] == 0) continue;
                        if (ct[j] % 2 == 0) {
                            even.add(j);
                        } else {
                            odd.add(j);
                        }
                    }
                    ans = (solveForThis(odd, even, ct.clone(), i, sum));
                    if (ans != null) {
                        out.println(ans);
                        return;
                    }
                }
            }
        }

        private String solveForThis(PriorityQueue<Integer> odd, PriorityQueue<Integer> even, int[] ct, int grp, int sum) {
            StringWriter sw = new StringWriter();
            PrintWriter out = new PrintWriter(sw);
            int[] cct = ct.clone();
            out.println(grp);
            int size = sum / grp;
            for (int groups = 1; groups <= grp; ++groups) {
                int[] s = new int[size];
                int i = 0;
                int j = size - 1;
                Integer val;
                while (i <= j) {
                    boolean ev = false, od = false;
                    if (j - i == 0) {
                        val = odd.poll();
                        od = true;
                    } else if (j - i > 0) {
                        val = even.poll();
                        ev = true;
                    } else {
                        break;
                    }
                    if (val == null) {
                        if (od) val = even.poll();
                        else if (ev) val = odd.poll();
                        else throw new RuntimeException();
                    }
                    if (i == j) {
                        s[i] = val;
                        ct[val] -= 1;
                        if (ct[val] != 0) {
                            if (ct[val] % 2 == 0) even.add(val);
                            else odd.add(val);
                        }
                    } else {
                        s[i] = s[j] = val;
                        ct[val] -= 2;
                        if (ct[val] != 0) {
                            if (ct[val] % 2 == 0) even.add(val);
                            else odd.add(val);
                        }
                    }
                    ++i;
                    --j;
                }
                for (int p = 0; p < size; ++p) {
                    out.print((char) (s[p]));
                    cct[s[p]]--;
                }
                out.print(" ");
            }
            boolean flag = true;
            for (int i = 0; i < cct.length; ++i) {
                flag &= cct[i] == 0;
            }
            if (!flag) {
                return null;
            }
            return sw.toString();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public char nextCharacter() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            return (char) c;
        }

        public char[] nextCharacterArray(int n) {
            char[] chars = new char[n];
            for (int i = 0; i < n; i++) {
                chars[i] = nextCharacter();
            }
            return chars;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class StringUtils {
        public static int[] countAll(char[] string) {
            int[] c = new int[128];
            for (char s : string) {
                c[s]++;
            }
            return c;
        }

    }
}