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 Q1 {
	
	static InputReader in=new InputReader(System.in);
	static PrintWriter out=new PrintWriter(System.out);
	static int T=1,N,M;
	static int A[];
 	static int dp[][];
	static ArrayList<Integer> graph[];
	public static void main(String args[])
	{
		//T=in.readInt();
		int i,j,k;
		while(T-->0)
		{
 			N=in.readInt();
			String S=in.readString();
			HashMap<Character,Integer> map = new HashMap<Character,Integer>();
			int co=0,ce=0;
			for(i=0;i<N;i++)
			{
				if(map.containsKey(S.charAt(i)))
					map.put(S.charAt(i),map.get(S.charAt(i))+1);
				else 
				    map.put(S.charAt(i),1);
			}
			Iterator itr = map.entrySet().iterator();
			Stack<Character> sto = new Stack<Character>();
			Stack<Character> ste = new Stack<Character>();
			while(itr.hasNext())
			{
				Map.Entry<Character,Integer> ent = (Map.Entry)itr.next();
				char key = (char)ent.getKey();
				int val = (int)ent.getValue();
				if(val%2==0){
					while(val!=0)
					{	
						ce++;
						ste.push(key);
						val-=2;
					}
				}
				else{ 
					co++;
					sto.push(key);
					val-=1;
					while(val!=0)
					{
						ste.push(key);
						ce++;
						val-=2;
					}
				}
				itr.remove();
			}
			//out.println(co+" "+ce);
			if(co==0)
			{
				out.println(1);
				Stack rev=new Stack();
				while(!ste.isEmpty())
				{
					rev.push(ste.peek());
					out.print(ste.pop());
				}
				while(!rev.isEmpty())
				{
					out.print(rev.pop());
				}
			}
			else
			{
				int temp=0,len=-1;
				//out.println(ce+" "+co);
				for(i=co;i<N;i+=2)
				{
					if((ce-temp)>=i&&(ce-temp)%i==0)
					{
						len=i;
						while(temp!=0){
						sto.push(ste.peek());
						sto.push(ste.pop());temp--;}
						break;
					}
					temp++;
				}
			//	out.println(sto.count());
			//	out.println(ste.count());
				if(len!=-1){
					out.println(len);
					while(!sto.isEmpty())
					{
						Stack rev=new Stack();
						int tp=0;
				//		out.println((N/len)/2);
						while(tp++<(N/len)/2)
						{
							rev.push(ste.peek());
							out.print(ste.pop());
						}
						out.print(sto.pop());
						while(!rev.isEmpty())
						{
							out.print(rev.pop());
						}
						out.print(" ");
					}
				}
				else
				{
					out.println(N);
					for(i=0;i<N;i++)
						out.print(S.charAt(i)+" ");
				}
			}
		}
		out.flush();
		out.close();
	}
	public static void printI0(int a[],int n)
	{
		for(int i=0;i<n;i++)
		{
			out.println(a[i]);
		}
	}
	public static void printI1(int a[],int n)
	{
		for(int i=1;i<=n;i++)
		{
			out.println(a[i]);
		}
	}	
	public static void printL0(long a[],int n)
	{
		for(int i=0;i<n;i++)
		{
			out.println(a[i]);
		}
	}
	public static void printL1(long a[],int n)
	{
		for(int i=1;i<=n;i++)
		{
			out.println(a[i]);
		}
	}
	public static void initializeGraph(int n)
	{
		graph=new ArrayList[n+1];
		for(int i=0;i<=n;i++)
			graph[i]=new ArrayList<Integer>();
	}
}
class Pair{
	char x;
	int y;
	public Pair(char x,int y)
	{
		this.x=x;
		this.y=y;
	}
}
class InputReader{
	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 int readInt(){
		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 void inputI0(int a[],int n)
	{
		for(int i=0;i<n;i++)
			a[i]=readInt();
	}
	public void inputI1(int a[],int n)
	{
		for(int i=1;i<=n;i++)
			a[i]=readInt();
	}
	public long readLong() {
		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 void inputL0(long a[],int n)
	{
		for(int i=0;i<n;i++)
			a[i]=readLong();
	}
	public void inputL1(long a[],int n)
	{
		for(int i=1;i<=n;i++)
			a[i]=readLong();
	}
	public double readDouble() {
      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, readInt());
			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, readInt());
				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);
	}
}