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.util.Map.Entry;
import java.lang.Math;
import java.math.BigInteger;

public class Problem {

	int INF = -1000 * 1000 * 1000 - 100;

	TreeMap<Character, Integer> count = new TreeMap<Character, Integer>();
	TreeSet<Character> odds = new TreeSet<Character>();
	int n;

	void solve() throws IOException {

		n = rI();
		char[] s = rS().toCharArray();

		for (char c : s) {
			if (count.containsKey(c)) {
				int val = count.get(c);
				count.put(c, val + 1);
				if (val % 2 == 0)
					odds.add(c);
				else
					odds.remove(c);
			} else {
				count.put(c, 1);
				odds.add(c);
			}
		}

		List<Integer> divs = new ArrayList<>();

		for (int i = 1; i * i <= n; ++i) {
			if (n % i == 0) {
				divs.add(i);
				divs.add(n / i);
			}
		}

		Collections.sort(divs);
		Collections.reverse(divs);

		for (int i : divs) {
			ArrayList<ArrayDeque<Character>> outp = new ArrayList<>();
			if (test(outp, i)) {
				out.println(n / i);
				for (ArrayDeque<Character> st : outp) {
					while(st.size() > 0){
						out.print(st.pop());
					}
					out.print(" ");
				}
				break;
			}
		}

	}

	boolean test(ArrayList<ArrayDeque<Character>> out, int del) {
		Set<Character> cop = (TreeSet<Character>) odds.clone();
		Map<Character, Integer> cop2 = (Map<Character, Integer>) count.clone();
		if (del % 2 == 1) {
			if(n/del < cop.size()) return false;
			for (Character c : cop) {
				ArrayDeque<Character> hjrht = new ArrayDeque<Character>();
				hjrht.add(c);
				out.add(hjrht);
				cop2.put(c, cop2.get(c) - 1);
				if (cop2.get(c) == 0)
					cop2.remove(c);
			}
			for (int i = 0; i < n / del - cop.size(); ++i) {
				Character some = (char) cop2.keySet().toArray()[0];
				ArrayDeque<Character> bijhe = new ArrayDeque<Character>();
				bijhe.add(some);
				out.add(bijhe);
				cop2.put(some, cop2.get(some) - 1);
				if (cop2.get(some) == 0)
					cop2.remove(some);
			}
		} else {
			for (int i = 0; i < n / del; ++i)
				out.add(new ArrayDeque<Character>());
		}

		return deepTest(out, del, cop, cop2);
	}

	boolean deepTest(ArrayList<ArrayDeque<Character>> out, int del, Set<Character> odds, Map<Character, Integer> count) {
		int level = 0;
		while (!count.isEmpty()) {
			char some = (char) count.keySet().toArray()[0];
			int cnt = count.get(some);
			if (cnt < 2)
				return false;
			
			out.get(level).addFirst(some);
			out.get(level).addLast(some);
			count.put(some, cnt - 2);
			if (cnt == 2)
				count.remove(some);
			if (level == out.size() - 1)
				level = 0;
			else
				level++;
		}
		if (level != 0)
			return false;
		return true;
	}

	public static void main(String[] args) throws IOException {

		new Problem().run();
	}

	boolean isLower(char a) {
		return ((int) a) >= 97 ? true : false;
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;
	Random rnd = new Random();
	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	Problem() throws FileNotFoundException {

		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
		tok = new StringTokenizer("");
	}

	long checkBit(long mask, int bit) {
		return (mask >> bit) & 1;
	}

	// ======================================================

	// ======================================================
	void run() throws IOException {
		solve();
		out.close();
	}

	char[] reverseCharArray(char[] arr) {
		char[] ans = new char[arr.length];
		for (int i = 0; i < arr.length; ++i) {
			ans[i] = arr[arr.length - i - 1];
		}
		return ans;
	}

	int sqrt(double m) {
		int l = 0;
		int r = 1000000000 + 9;
		int i = 1000;
		while (r - l > 1) {
			int mid = (r + l) / 2;
			if (mid * mid > m) {
				r = mid;
			} else {
				l = mid;
			}
		}
		return l;
	}

	int countPow(int m, int n) {
		int ans = 0;
		while (m % n == 0 && m > 0) {
			ans++;
			m /= n;
		}
		return ans;
	}

	long binPow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b % 2 == 1) {
			return a * binPow(a, b - 1);
		} else {
			long c = binPow(a, b / 2);
			return c * c;
		}

	}

	int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	long pow(long x, long k) {
		long ans = 1;
		for (int i = 0; i < k; ++i) {
			ans *= x;
		}
		return ans;
	}

	// ////////////////////////////////////////////////////////////////////

	String delimiter = " ";

	String readLine() throws IOException {
		return in.readLine();
	}

	String rS() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine)
				return null;

			tok = new StringTokenizer(nextLine);
		}

		return tok.nextToken(delimiter);
	}

	int rI() throws IOException {
		return Integer.parseInt(rS());
	}

	long rL() throws IOException {
		return Long.parseLong(rS());
	}

	double rD() throws IOException {
		return Double.parseDouble(rS());
	}

	int[] rA(int b) {
		int a[] = new int[b];
		for (int i = 0; i < b; i++) {
			try {
				a[i] = rI();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return a;
	}

	int[] readSortedIntArray(int size) throws IOException {
		Integer[] array = new Integer[size];

		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}

	int[] sortedIntArray(int size, int[] array) throws IOException {
		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}
}