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:
//>>>BaZ<<<//
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{  
    static int dx[] = {-1,1,0,0};
    static int dy[] = {0,0,1,-1};
    static long MOD = 1000000007;
    static int INF = Integer.MAX_VALUE/10;
    static PrintWriter pw;
    static InputReader scan;
    static int ni(){return scan.nextInt();}
    static long nl(){return scan.nextLong();}
    static double nd(){return scan.nextDouble();}
    static String ne(){return scan.next();}
    static void pl(){pw.println();}
    static void pl(Object o){pw.println(o);}
    static void p(Object o){pw.print(o+" ");}
    static void psb(StringBuilder sb){pw.print(sb);}
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",99999999)
        {
            public void run()
            {
                try
                {
                    solve();
                }
                catch(Exception e)
                {  
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static void solve() throws IOException
    {
        scan = new InputReader(System.in);
        pw = new PrintWriter(System.out,true);
        StringBuilder sb = new StringBuilder();
        int n = ni();
        String s = ne();
        Map<Character,Integer> freq = new HashMap();
        for(int i=0;i<n;++i)
        {
            char c = s.charAt(i);
            if(freq.containsKey(c))
                freq.put(c,freq.get(c)+1);
            else freq.put(c,1);
        }
        LinkedList<Pair> odd = new LinkedList();
        LinkedList<Pair> even = new LinkedList();
        LinkedList<Pair> one = new LinkedList();
        int oddf = 0;
        for(char c:freq.keySet())
        {  
            int f = freq.get(c);
            if(f%2==0)
                even.add(new Pair(c,f));
            else
            {
                ++oddf;
                if(f==1)
                    one.add(new Pair(c,1));
                else odd.add(new Pair(c,f));
            }
        }
        for(int nparts=1;nparts<=n;++nparts)
        {
            if(n%nparts!=0)
                continue;
            int l = n/nparts;
            if(l%2==0)
            {
                if(oddf==0)
                {
                    pl(nparts);
                    for(int i=0;i<nparts;++i)
                    {
                        char res[] = new char[l];
                        int by2 = l/2;
                        for(int j=0;j<by2;++j)
                        {
                            Pair curr = even.poll();
                            res[j] = res[l-1-j] = curr.c;
                            curr.freq-=2;
                            if(curr.freq>0)
                                even.addFirst(curr);
                        }
                        for(int j=0;j<l;++j)
                            pw.print(res[j]);
                        pw.print(" ");
                    }
                    pw.flush();
                    System.exit(0);
                }
            }
            else
            {
                if((nparts-oddf)%2==0 && nparts>=oddf)
                {
                    pl(nparts);
                    for(int i=0;i<nparts;++i)
                    {
                        char res[] = new char[l];
                        if(!one.isEmpty())
                        {
                            Pair curr = one.poll();
                            res[l/2] = curr.c;
                        }
                        else if(!odd.isEmpty())
                        {
                            Pair curr = odd.poll();
                            res[l/2] = curr.c;
                            curr.freq--;
                            even.add(curr);
                        }
                        else
                        {
                            Pair curr = even.poll();
                            res[l/2] = curr.c;
                            curr.freq--;
                            if(curr.freq==1)
                                one.add(curr);
                            else odd.add(curr);
                        }
                        int by2 = l/2;
                        for(int j=0;j<by2;++j)
                        {  
                            if(!even.isEmpty())
                            {
                                Pair curr = even.poll();
                                res[j] = res[l-1-j] = curr.c;
                                curr.freq-=2;
                                if(curr.freq>0)
                                   even.add(curr);
                            }
                            else
                            {
                                Pair curr = odd.poll();
                                res[j] = res[l-1-j] = curr.c;
                                curr.freq-=2;
                                if(curr.freq>0)
                                {
                                    if(curr.freq==1)
                                        one.add(curr);
                                    else odd.add(curr);
                                }  
                            }
                        }
                        for(int j=0;j<l;++j)
                            pw.print(res[j]);
                        pw.print(" ");
                    }
                    pw.flush();
                    System.exit(0);
                }
            }
        }
        pw.flush();
        pw.close();
    }
    static class Pair
    {
        Character c;
        int freq;
        Pair(Character c,int freq)
        {
            this.c=c;this.freq = freq;
        }
    }
    static boolean islong(double d)
    {
        return Math.ceil(d)==d;
    }
    static double roundLikeCpp(double d,double precision)
    {   
        if(islong(d))
            return d;
        d*=(long)pow(10,precision+1);
        if(d%10==5)
            d--;
        return d/pow(10,precision+1);
    }
    static class InputReader     //NoSuchElementException -> EOF
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}
		
		public int read()
		{
			if (numChars==-1) 
				throw new InputMismatchException();
			
			if (curChar >= numChars)
			{
				curChar = 0;
				try 
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
				
				if(numChars <= 0)				
					return -1;
			}
			return buf[curChar++];
		}
	 
		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();
			
			while(isSpaceChar(c)) 
				c = read();
			
			int sgn = 1;
			
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			
			int res = 0;
			do 
			{
				if(c<'0'||c>'9') 
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c)); 
			
			return res * sgn;
		}
		
		public long nextLong() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			long res = 0;
			
			do 
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}
		
		public double nextDouble() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') 
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') 
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) 
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
		
		public String readString() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do 
			{
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
			
			return res.toString();
		}
	 
		public boolean isSpaceChar(int c) 
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		public String next() 
		{
			return readString();
		}
		
		public interface SpaceCharFilter 
		{
			public boolean isSpaceChar(int ch);
		}
	}
}