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.*;

public class tr7 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		String s = br.readLine();
		TreeMap<Character, Integer> even = new TreeMap<>(), odd = new TreeMap<>();
		for (int i = 0; i < n; i++) {
			char x = s.charAt(i);
			int max = Math.max(even.getOrDefault(x, 0), odd.getOrDefault(x, 0));
			max++;
			if (max % 2 == 0) {
				odd.remove(x);
				even.put(x, max);
			} else {
				even.remove(x);
				odd.put(x, max);
			}
		}
		ArrayList<Integer> divs = new ArrayList<>();
		for (int d = 1; d <= n / d; d++) {
			if (n % d != 0)
				continue;
			divs.add(d);
			if (d != n / d)
				divs.add(n / d);
		}
		int ans = 0;
		Collections.sort(divs, Collections.reverseOrder());
		ArrayList<char[]> pr = new ArrayList<>();
		for (int p : divs) {
			if (p % 2 == 0 && odd.size() > 0)
				continue;
			if (p % 2 == 1) {
				int num = n / p;
				if (odd.size() > num)
					continue;
				int rest = num - odd.size();
				if (rest % 2 == 1)
					continue;
			}
			int num = n / p;
			for (int i = 0; i < num; i++)
				pr.add(new char[p]);
			if (p % 2 == 0) {
				int id = 0;
				int pos = 0;
				for (Character g : even.keySet()) {
					int c = even.get(g);
					while (c > 0) {
						pr.get(id)[pos] = g;
						pr.get(id)[p - pos - 1] = g;
						id++;
						if (id == num) {
							id = 0;
							pos++;
						}
						c -= 2;
					}
				}
			} else {
				int idx = 0;
				while (!odd.isEmpty()) {
					char k = odd.firstKey();
					int gk = odd.get(k);
					odd.pollFirstEntry();
					pr.get(idx)[p / 2] = k;
					if (gk != 1)
						even.put(k, gk - 1);
					idx++;
				}
				while (idx < num) {
					char k = even.firstKey();
					int gk = even.get(k);
					even.remove(k);
					pr.get(idx)[p / 2] = k;
					idx++;
					pr.get(idx)[p / 2] = k;
					idx++;
					gk -= 2;
					if (gk > 0)
						even.put(k, gk);
				}
				int id = 0;
				int pos = 0;
				for (Character g : even.keySet()) {
					int c = even.get(g);
					while (c > 0) {
						pr.get(id)[pos] = g;
						pr.get(id)[p - pos - 1] = g;
						id++;
						if (id == num) {
							id = 0;
							pos++;
						}
						c -= 2;
					}
				}
			}
			ans = num;
			break;

		}
		out.println(ans);
		for (char[] y : pr)
			out.print(new String(y) + " ");
		out.flush();
	}

}