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.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author rokk-
 */
public class ACM2017H {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();
        String string = scanner.nextLine();
        int numPairs = 0, numSingles = 0;
        HashMap<Character, Integer> charCounts = new HashMap<Character, Integer>();
        Queue<Character> pairs = new LinkedList<Character>();
        Queue<Character> singles = new LinkedList<Character>();
        for (int i = 0; i < n; i++) {
            char c = string.charAt(i);
            if (!charCounts.containsKey(c)) {
                charCounts.put(c, 0);
            }
            int count = charCounts.get(c) + 1;
            charCounts.put(c, count);
            if (count % 2 == 0) {
                numPairs++;
                pairs.add(c);
            }
        }
        for (char key : charCounts.keySet()) {
            if (charCounts.get(key) % 2 == 1) {
                numSingles++;
                singles.add(key);
            }
        }
        int numPalindromes = 0;
        if (numSingles < numPairs) {
            while (numSingles > 0) {
                if (numPairs % numSingles == 0) {
                    break;
                }
                numPairs--;
                numSingles+=2;
                char c= pairs.remove();
                singles.add(c);
                singles.add(c);
                
            }
        }
        if (numSingles == 0) {
            numPalindromes = 1;
            System.out.println("" + numPalindromes);
            char[] temp = new char[n];
            for (int j = 0; j < temp.length / 2; j++) {
                char c = pairs.remove();
                temp[j] = c;
                temp[temp.length - 1 - j] = c;
            }
            System.out.print(new String(temp) + " ");
        } else if (numPairs >= numSingles && numPairs % numSingles == 0) {
            numPalindromes = numSingles;
            System.out.println("" + numPalindromes);
            for (int i = 0; i < numPalindromes; i++) {
                char[] temp = new char[numPairs / numSingles * 2 + 1];
                temp[(temp.length - 1) / 2] = singles.remove();
                for (int j = 0; j < (temp.length - 1) / 2; j++) {
                    char c = pairs.remove();
                    temp[j] = c;
                    temp[temp.length - 1 - j] = c;
                }
                System.out.print(new String(temp) + " ");
            }
        } else if (numPairs != numSingles) {

            numPalindromes = n;
            System.out.println("" + numPalindromes);
            for (int i = 0; i < n; i++) {
                System.out.print(string.charAt(i) + " ");
            }
        }

    }

}