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.math.BigInteger;
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;

public class TestClass{

    static class Parser
    {
        final private int BUFFER_SIZE = 1 << 16;

        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Parser(InputStream in)
        {
            din = new DataInputStream(in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public long nextLong() throws Exception
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = c == '-';
            if (neg) c = read();
            do
            {
                ret = ret * 10 + c - '0';
                c = read();
            } while (c > ' ');
            if (neg) return -ret;
            return ret;
        }

        //reads in the next string
        public String next() throws Exception
        {
            StringBuilder ret =  new StringBuilder();
            byte c = read();
            while (c <= ' ') c = read();
            do
            {
                ret = ret.append((char)c);
                c = read();
            } while (c > ' ');
            return ret.toString();
        }

        public int nextInt() throws Exception
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = c == '-';
            if (neg) c = read();
            do
            {
                ret = ret * 10 + c - '0';
                c = read();
            } while (c > ' ');
            if (neg) return -ret;
            return ret;
        }

        private void fillBuffer() throws Exception
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1) buffer[0] = -1;
        }

        private byte read() throws Exception
        {
            if (bufferPointer == bytesRead) fillBuffer();
            return buffer[bufferPointer++];
        }
    }
    static class OutputWriter
    {
        private PrintWriter writer;

        public OutputWriter(OutputStream stream)
        {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
                    stream)));
        }

        public OutputWriter(Writer writer)
        {
            this.writer = new PrintWriter(writer);
        }

        public void println(int x)
        {
            writer.println(x);
        }

        public void print(int x)
        {
            writer.print(x);
        }

        public void println(char x)
        {
            writer.println(x);
        }

        public void print(char x)
        {
            writer.print(x);
        }

        public void println(int array[], int size)
        {
            for (int i = 0; i < size; i++)
                println(array[i]);
        }

        public void print(int array[], int size)
        {
            for (int i = 0; i < size; i++)
                print(array[i] + " ");
        }

        public void println(long x)
        {
            writer.println(x);
        }

        public void print(long x)
        {
            writer.print(x);
        }

        public void println(long array[], int size)
        {
            for (int i = 0; i < size; i++)
                println(array[i]);
        }

        public void print(long array[], int size)
        {
            for (int i = 0; i < size; i++)
                print(array[i]);
        }

        public void println(float num)
        {
            writer.println(num);
        }

        public void print(float num)
        {
            writer.print(num);
        }

        public void println(double num)
        {
            writer.println(num);
        }

        public void print(double num)
        {
            writer.print(num);
        }

        public void println(String s)
        {
            writer.println(s);
        }

        public void print(String s)
        {
            writer.print(s);
        }

        public void println()
        {
            writer.println();
        }

        public void printSpace()
        {
            writer.print(" ");
        }

        public void printf(String format, Object args)
        {
            writer.printf(format, args);
        }

        public void flush()
        {
            writer.flush();
        }

        public void close()
        {
            writer.close();
        }

    }
    static int count[];
    public static void main(String args[]) throws Exception {

        Parser s = new Parser(System.in);
        OutputWriter out = new OutputWriter(System.out);
       int N=s.nextInt();
        char str[]=s.next().toCharArray();
        char ch[]=new char[62];
        int k=0;
        int start_a=0;
        for (int i = 0; i <26 ; i++) {
            ch[k++]=(char)(i+'a');
        }
        int start_A=k;
        for (int i = 0; i <26 ; i++) {
            ch[k++]=(char)(i+'A');
        }
        int start_0=k;
        for (int i = 0; i <10 ; i++) {
            ch[k++]=(char)(i+'0');
        }

        count=new int[62];
        for (int i = 0; i <str.length; i++) {
            int x=str[i];
            if(x>=48&&x<=57){
                int y=str[i]-'0';
                count[start_0+y]++;
            }
            else{
                if(x>=65&&x<=90){
                    int y=str[i]-'A';
                    count[start_A+y]++;
                }
                else{
                    int y=str[i]-'a';
                    count[start_a+y]++;
                }
            }
        }
        int even=0;
        int odd=0;
        int even_count=0;
        ArrayList<Character> list_even=new ArrayList<Character>();
        ArrayList<Character> list_odd=new ArrayList<Character>();
        for (int i = 0; i <62 ; i++) {
            if(count[i]>0){
                int x=count[i]%2;
                if(x==0){
                    even++;
                even_count+=count[i];
                    for (int j = 0; j <count[i] ; j++) {
                        list_even.add(ch[i]);
                    }
                }
                else{
                    odd++;
                even_count+=count[i];
                even_count--;
                    for (int j = 0; j <count[i]-1 ; j++) {
                        list_even.add(ch[i]);
                    }
                    list_odd.add(ch[i]);
                }
            }
        }
        if(odd==0){
            Deque<Character> ans=new LinkedList<>();
            for (int i = 0; i <list_even.size() ; i++) {
                ans.addFirst(list_even.get(i));
                i++;
                ans.addLast(list_even.get(i));
            }
            out.println(1);
            while (ans.size()>0){
                out.print(ans.poll()+"");
            }
        }
        else {
           // System.out.println("here");
            int pairs=even_count/2;
            int ans=N;
            for (int i = odd; i <=N ; i++) {
              //  System.out.println(i+" xx");
                if(N%i==0){
                    int left=N/i;
                    int sec=(N-i)/2;
                    if(sec%i==0){
                        ans=i;
                        break;
                    }
                }
            }
            if(true){
                int div=N/ans;
             //   System.out.println(ans);
                Deque<Character> arr[]=new LinkedList[ans];
                for (int i = 0; i <ans ; i++) {
                    arr[i]=new LinkedList<>();
                }
                int m=0;
                for ( m = 0; m <list_odd.size() ; m++) {
                    arr[m].addFirst(list_odd.get(m));
                }
              //  System.out.println(m);
                int j=0;
                while (m<ans){
                  //  System.out.println(m+" "+j+" "+ans);
                    arr[m++].addFirst(list_even.get(j++));
                }
                for (int f = 0; f < ans ; f++) {
                for (int i = 0; i <(div-1)/2 ; i++) {
                    arr[f].addFirst(list_even.get(j++));
                    arr[f].addLast(list_even.get(j++));
                }}
                out.println(ans);
                for (int i = 0; i <ans ; i++) {
                    while (arr[i].size()>0){
                        out.print(arr[i].poll()+"");
                    }
                  out.print(" ");
                }
            }
//            else{
//                out.println(N);
//                for (int i = 0; i <str.length ; i++) {
//
//                    out.print(str[i]+" ");
//                }
//            }
        }

out.close();
}}