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.InputStream;
import java.io.InputStreamReader;
import java.util.*;

/**
 * Created by dtnha on 10/20/2017.
 */
public class PalindromicCut {


    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        int n = Reader.nextInt();
        String s = Reader.next();
        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            char c = s.charAt(i);
            if (map.containsKey(c)) {
                map.put(c, map.get(c) + 1);
            } else {
                map.put(c, 1);
            }
        }


        Set<Character> keys = map.keySet();
        List<Character> oddCharacterList = new ArrayList<>();
        StringBuffer evenCharacterBuffer = new StringBuffer();

        for (Character c : keys) {
            int value = map.get(c);
            if (value % 2 == 0) {
                for (int i = 0; i < value; i++) {
                    evenCharacterBuffer.append(c);
                }
            } else {
                oddCharacterList.add(c);
                for (int i = 0; i < value - 1; i++) {
                    evenCharacterBuffer.append(c);
                }
            }
        }

        int evenLength = evenCharacterBuffer.length();
        int oddSize = oddCharacterList.size();
        StringBuffer res = new StringBuffer();
        if (oddSize == 0 || oddSize == 1) {
            res.append(1 + "\n");
            StringBuffer leftCharacters = new StringBuffer();
            int x = 0;
            while (x <= evenLength - 1) {
                leftCharacters.append(evenCharacterBuffer.charAt(x));
                x = x + 2;
            }
            res.append(leftCharacters);
            for (Character c : oddCharacterList) {
                res.append(c);
            }
            StringBuffer rightCharacters = leftCharacters.reverse();
            res.append(rightCharacters);

        } else {
            int minsubString = oddSize;
            int len = 0;
            while (minsubString <= n) {
                if (n % minsubString == 0) {
                    len = n / minsubString;
                    if (len % 2 == 1) {
                        break;
                    }
                }
                minsubString++;
            }
            if (len >= 3) {
                res.append(minsubString + "\n");
                int x = 0;
                for (int i = 0; i < oddSize; i++) {
                    StringBuffer word = new StringBuffer();
                    Character oddC = oddCharacterList.get(i);
                    int distance = len - 1;
                    StringBuffer left = new StringBuffer();
                    while (distance > 0) {
                        left.append(evenCharacterBuffer.charAt(x));
                        distance = distance - 2;
                        x = x + 2;
                    }

                    word.append(left);
                    word.append(oddC);
                    StringBuffer right = left.reverse();
                    word.append(right);
                    res.append(word + " ");
                }

                Character oddC = null;
                for (int i = oddSize; i < minsubString; i++) {
                    StringBuffer word = new StringBuffer();
                    StringBuffer left = new StringBuffer();
                    int distance = len - 1;
                    while (distance > 0) {
                        left.append(evenCharacterBuffer.charAt(x));
                        distance = distance - 2;
                        x = x + 2;
                    }
                    word.append(left);
                    if (oddC != null) {
                        word.append(oddC);
                        oddC = null;
                    } else {
                        oddC = evenCharacterBuffer.charAt(x);
                        word.append(oddC);
                        x = x+2;
                    }

                    StringBuffer right = left.reverse();
                    word.append(right);
                    res.append(word + " ");
                }

            } else {
                res.append(n + "\n");
                for (int i = 0; i < n; i++) {
                    res.append(s.charAt(i) + " ");
                }
            }
        }

        System.out.println(res.toString());


    }


    private static class Reader {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        /**
         * call this method to initialize reader for InputStream
         */
        public static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        /**
         * get next word
         */
        public static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                //TODO add check for eof if necessary
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

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

        public static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }
}