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

public class _883_H {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(in.readLine());
        String s = in.readLine();
        HashMap<Character, Integer> freqs = new HashMap<Character, Integer>();
        for(int i = 0; i < n; i++) {
            char c = s.charAt(i);
            Integer freq = freqs.get(c);
            if(freq == null) freq = 0;
            freqs.put(c, freq + 1);
        }
        char[][] res = null;
        for(int i = 1; i <= n; i++) {
            res = split(n, i, freqs);
            if(res != null) break;
        }
        out.println(res.length);
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < res.length; i++) {
            for(int j = 0; j < res[i].length; j++) {
                sb.append(res[i][j]);
            }
            if(i < res.length - 1) sb.append(' ');
        }
        out.println(sb.toString());
        in.close();
        out.close();
    }
    static char[][] split(int n, int k, HashMap<Character, Integer> freqs) {
        if(n % k != 0) return null;
        int size = n / k;
        char[][] pals = new char[k][size];
        if(size % 2 == 0) {
            boolean alleven = true;
            for(char c : freqs.keySet()) {
                if(freqs.get(c) % 2 == 1) alleven = false;
            }
            if(!alleven) return null;
            int rp = 0;
            int cp = 0;
            for(char c : freqs.keySet()) {
                int freq = freqs.get(c);
                for(int i = 0; i < freq; i += 2) {
                    pals[rp][cp] = c;
                    pals[rp][size - cp - 1] = c;
                    cp++;
                    if(cp >= size / 2) {
                        cp = 0;
                        rp++;
                    }
                }
            }
        }else {
            int mid = size / 2;
            int numodd = 0;
            for(char c : freqs.keySet()) {
                if(freqs.get(c) % 2 == 1) numodd++;
            }
            if(numodd > k) return null;
            HashMap<Character, Integer> freqs2 = new HashMap<Character, Integer>();
            int rp = 0;
            for(char c : freqs.keySet()) {
                int freq = freqs.get(c);
                if(freq % 2 == 1) {
                    pals[rp][mid] = c;
                    if(freq > 1) {
                        freqs2.put(c, freq - 1);
                    }
                    rp++;
                }else {
                    freqs2.put(c, freq);
                }
            }
            HashMap<Character, Integer> freqs3 = new HashMap<Character, Integer>(); 
            for(char c : freqs2.keySet()) {
                int freq = freqs2.get(c);
                int left = freq;
                for(int i = 0; i < freq; i++) {
                    if(rp >= pals.length) break;
                    pals[rp][mid] = c;
                    rp++;
                    left--;
                }
                if(left > 0) {
                    freqs3.put(c, left);
                }
            }
            rp = 0;
            int cp = 0;
            for(char c : freqs3.keySet()) {
                int freq = freqs3.get(c);
                for(int i = 0; i < freq; i += 2) {
                    pals[rp][cp] = c;
                    pals[rp][size - cp - 1] = c;
                    cp++;
                    if(cp >= mid) {
                        cp = 0;
                        rp++;
                    }
                }
            }
        }
        return pals;
    }
}