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.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class H {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String word = sc.next();


        Map<Character, Integer> count = new HashMap<>();
        for (Character c : word.toCharArray()) {
            count.put(c, count.getOrDefault(c, 0) + 1);
        }


        int k = solveK(n, count);
        System.out.println(k);

        StringBuilder res = new StringBuilder();

        for(int i = 0; i < k; i++) res.append(construct(n / k, count)).append(" ");

        System.out.println(res);

    }

    private static String construct(int len, Map<Character, Integer> count) {
        StringBuilder res = new StringBuilder();
        if(len % 2 == 0){
            for(int i = 0; i < len / 2; i++){
                for(Character key: count.keySet()){
                    if(count.get(key) > 0) {
                        count.put(key, count.get(key) - 2);
                        res.append(key);
                        break;
                    }
                }
            }
        }
        else {
            for(int i = 0; i < len / 2; i++){
                for(Character key: count.keySet()){
                    if(count.get(key) >= 2) {
                        count.put(key, count.get(key) - 2);
                        res.append(key);
                        break;
                    }
                }
            }

            boolean find = false;
            for(Character key: count.keySet()){
                if(count.get(key) % 2 == 1) {
                    res.append(key);
                    count.put(key, count.get(key) - 1);
                    find = true;
                    break;
                }
            }
            if(!find){
                for(Character key: count.keySet()){
                    if(count.get(key) > 0 ) {
                        res.append(key);
                        count.put(key, count.get(key) - 1);
                        break;
                    }
                }
            }
        }

        for(int i = 0; i < len / 2; i++){
            res.append(res.charAt(len / 2 - i - 1));
        }

        return res.toString();
    }

    private static int solveK(int n, Map<Character, Integer> count) {
        int odd = 0;

        for (int x : count.values()) {
            if (x % 2 == 1) odd += 1;
        }
        for (int k = 1; k <= n; k++) {
            if (n % k != 0) continue;

            int len = n / k;
            if (len % 2 == 0 && odd == 0) return k;
            if (len % 2 == 0 && odd != 0) continue;

            if(k < odd) continue;
            if(k == odd) return k;

            if( (k - odd) % 2 == 0) return k;

        }

        return n;
    }
}