Returning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its reverse. For example, strings "pop", "noon", "x", and "kkkkkk" are palindromes, while strings "moon", "tv", and "abab" are not. An empty string is also a palindrome.

Gildong loves this concept so much, so he wants to play with it. He has n distinct strings of equal length m. He wants to discard some of the strings (possibly none or all) and reorder the remaining strings so that the concatenation becomes a palindrome. He also wants the palindrome to be as long as possible. Please help him find one.

Input

The first line contains two integers n and m (1 ≤ n ≤ 100, 1 ≤ m ≤ 50) — the number of strings and the length of each string.

Next n lines contain a string of length m each, consisting of lowercase Latin letters only. All strings are distinct.

Output

In the first line, print the length of the longest palindrome string you made.

In the second line, print that palindrome. If there are multiple answers, print any one of them. If the palindrome is empty, print an empty line or don't print this line at all.

Examples

Input


3 3
tab
one
bat


Output


6
tabbat


Input


4 2
oo
ox
xo
xx


Output


6
oxxxxo


Input


3 5
hello
codef
orces


Output


0



Input


9 4
abab
baba
abcd
bcde
cdef
defg
wxyz
zyxw
ijji


Output


20
ababwxyzijjizyxwbaba

Note

In the first example, "battab" is also a valid answer.

In the second example, there can be 4 different valid answers including the sample output. We are not going to provide any hints for what the others are.

In the third example, the empty string is the only valid palindrome string.
/******************************************
 *  Author : Atul Anand   
 *  Created On : Sat Feb 15 2020
 *******************************************/

import java.io.*;
import java.util.*;

public class B{
    
    public static void main(String[] args) throws IOException {
        int n=in.nextInt();
        int m=in.nextInt();
        List<String> S=new ArrayList<String>();
        for(int i=0;i<n;i++){
            S.add(in.next());
        }
        List<String> p1=new ArrayList<String>();
        List<String> p2=new ArrayList<String>();

        while(true){
            boolean found=false;
            int x=-1;
            int y=-1;
            for(int i=0;i<S.size() && found==false;i++){
                for(int j=i+1;j<S.size();j++){
                    if(S.get(i).equals(new StringBuilder(S.get(j)).reverse().toString())){
                        found=true;
                        x=i;
                        y=j;
                        break;
                    }
                }
            }
            if(found){
                p1.add(S.get(x));
                p2.add(S.get(y));
                S.remove(x);
                S.remove(y-1);
            }
            else{
                break;
            }
        }
        StringBuilder ans1=new StringBuilder();
        StringBuilder ans2=new StringBuilder();
        int pairs=p1.size();
        for(int i=0;i<pairs;i++){
            ans1.append(p1.get(i));
            ans2.append(p2.get(pairs-i-1));
        }
        for(int i=0;i<S.size();i++){
            if(palindrome(S.get(i), m)){
                ans1.append(S.get(i).toString());
                break;
            }
        }
        String ans=ans1.toString()+ans2.toString();
        println(ans.length());
        println(ans);
        in.close();
        out.close();
    }

    public static boolean palindrome(String s, int m){
        int i=0;
        int j=m-1;
        while(i<j){
            if(s.charAt(i)!=s.charAt(j)){
                return false;
            }
            i++;
            j--;
        }
        return true;
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);
    static void read(int arr[], int N) throws IOException{ for(int i=0;i<N;i++){ arr[i]=in.nextInt(); } }
    static void read(long arr[], int N) throws IOException{ for(int i=0;i<N;i++){ arr[i]=in.nextLong(); } }
    static void read(String arr[], int N) throws IOException{ for(int i=0;i<N;i++){ arr[i]=in.next(); } }
    static void print(Object O){ out.print(O); }
    static void println(Object O){ out.println(O); }
    static void print(int arr[]){ for(int i=0;i<arr.length;i++){ print(arr[i]+" "); } println(""); }
    static void print(int arr[][]){ for(int i=0;i<arr.length;i++){ print(arr[i]); } }
    static void debug(Object O){ System.out.println(O); }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer=new StringTokenizer(reader.readLine()); }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { return Integer.parseInt(next()); }
    double nextDouble() throws IOException { return Double.parseDouble(next()); }
    long nextLong() throws IOException { return Long.parseLong(next()); }
    String nextLine() throws IOException { return reader.readLine(); }
    void close() throws IOException { reader.close(); }
}