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

public class main {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static PrintWriter pw = new PrintWriter(System.out);
    public static String line;
    public static StringTokenizer st;
    public static ArrayList<ArrayList<Integer>> adjList;
    public static int[] dx = {-1, 0, 1, 0, -1, 1, 1, -1};
    public static int[] dy = {0, 1, 0, -1, 1, 1, -1, -1};
    public static int INF = 0x3f3f3f3f;
    public static int MOD = 1000000007;

    public static boolean valid(int parts, int size, int A, int B){
        if(size % 2 == 0){
            return A == 0;
        } else{
            return A <= parts && (parts - A) % 2 == 0;
        }
    }

    public static void main(String[] args) throws Exception{
        int N = Integer.parseInt(br.readLine());
        HashMap<Character, Integer> d = new HashMap<Character, Integer>();
        String s = br.readLine();
        for(int i = 0; i < N; i++){
            char c = s.charAt(i);
            if(!d.containsKey(c)) d.put(c, 0);
            d.put(c, d.get(c)+1);
        }
        ArrayList<Character> A = new ArrayList<Character>();
        ArrayList<Character> B = new ArrayList<Character>();
        StringBuilder s1 = new StringBuilder();
        StringBuilder s2 = new StringBuilder();

        for(Character c : d.keySet()){
            for(int i = 0; i < d.get(c)/2; i++){
                B.add(c);
            }
            if(d.get(c) % 2 != 0){
                A.add(c);
            }
        }

        ArrayList<Integer> PF = new ArrayList<Integer>();
        for(int i = 1; i * i <= N; i++){
            if(N % i == 0){
                PF.add(i);
                if(i * i != N) PF.add(N/i);
            }
        }
        Collections.sort(PF);
        int ans = 0;
        for(int i = 0; i < PF.size(); i++){
            int parts = PF.get(i);
            int size = N / parts;
            if(valid(parts, size, A.size(), B.size())){
                ans = PF.get(i);
                break;
            }
        }
        // System.out.println(A+  " "  + B);
        int a1 = 0;
        int b1 = 0;
        pw.print(ans + "\n");
        for(int i = 0; i < ans; i++){
            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            int size = N / ans;
            for(int j = 0; j < size/2; j++){
                sb1.append(B.get(b1));
                sb2.append(B.get(b1));
                b1++;
            }
            if(size % 2 != 0){
                if(a1 >= A.size()){
                    A.add(B.get(b1));
                    A.add(B.get(b1));
                    b1++;
                }
                sb1.append(A.get(a1));
                a1++;
            }
            pw.print(sb1.toString() + sb2.reverse().toString());
            pw.print(i == ans-1 ? "\n" : " ");
        }

        pw.close(); 
        br.close();
    }
}

class Pair{
    public long x, y;

    Pair(long _x, long _y){
        x = _x;
        y = _y;
    }
}
class Point implements Comparable<Point>{
    public double x, y;

    Point(double x, double y){
        this.x = x;
        this.y = y;
    }

    public int compareTo(Point p){
        if(x != p.x) return x < p.x ? -1 : 1;
        else if(y != p.y) return y < p.y ? -1 : 1;
        return 0;
    }
}