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.

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

// * Definition for a binary tree node.
public class Main {
    public static final long MOD = 998244353;
    private String[] strs;
    public int gcd(int a, int b) {
        while (b != 0) {
            int temp = a;
            a = b;
            b = temp % b;
        }
        return a;
    }

    long powMod(long a, long p) {
        long ans = 1;
        while (p != 0) {
            if ((p & 1) == 1) ans = (ans*a) % MOD;
            p >>= 1;
            a = (a*a) % MOD;
        }
        return ans%MOD;
    }
    public int[] fibonaci(){
        int[] fib=new int[100];
        fib[0]=0;
        fib[1]=1;
        for(int i=2;i<=100;i++) fib[i]=fib[i-1]+fib[i-2];
        return fib;
    }
    public int find(int[] parent,int node){
        int height=0;
        int pre=parent[node];
        while(pre!=-1){
            pre=parent[pre];
            height++;
        }
        return height;
    }
    public boolean isPralindrome(String s){
        int i=0,j=s.length()-1;
        while(i<j){
            if(s.charAt(i)==s.charAt(j)) {
                i++;
                j--;
            }
            else return false;
        }
        return true;
    }
    public boolean isPralindrome(String s1,String s2){
        int i=0,j=s2.length()-1;
        while(i!= s1.length()&&j!=-1){
            if(s1.charAt(i)==s2.charAt(j)) {
                i++;
                j--;
            }
            else return false;
        }
        return true;
    }
    public int hasAnotherPar(int j){
        for(int i=0;i<j;i++){
            if(isPralindrome(strs[i],strs[j])) return i;
        }
        return -1;

    }
    public void solve() {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int k=in.nextInt();
        strs=new String[n+1];
        String single="";
        HashMap<Integer,Integer> map=new HashMap<>();
        StringBuilder res=new StringBuilder("");
        for(int i=0;i<n;i++) {
            strs[i]=in.next();
            if(isPralindrome(strs[i])&&single.equals("")) single=strs[i];
            else if((k=hasAnotherPar(i))!=-1) map.put(i,k);
        }
        int keys[]=new int[map.keySet().size()];
        int index=0;
        for(Integer e:map.keySet()){
            res.append(strs[e]);
            keys[index++]=e;
        }
        if(!single.equals("")) res.append(single);
        for(int i=index-1;i>=0;i--) res.append(strs[map.get(keys[i])]);
        System.out.println(res.length());
System.out.println(res.toString());
    }
    public List<Character> computeAdd(List<Character> l1,List<Character> l2){
        int cf=0;
        List<Character> o1=new ArrayList<>();
        List<Character> o2=new ArrayList<>();
        for(int i=0;i<Math.min(l1.size(),l2.size());i++){
            int d1=l1.get(l1.size()-i-1)-'0';
            int d2=l2.get(l2.size()-i-1)-'0';
//            int res=(d1+d2)%10;
            o1.add(String.valueOf((d1+d2+cf)%10).charAt(0));
            if(d1+d2+cf>=10) cf=1;
            else cf=0;
//4965 248

        }
        if(l1.size()>l2.size()) {
            for(int i=l1.size()-l2.size()-1;i>=0;i--){
                int d1=l1.get(i)-'0';
                o1.add(String.valueOf((d1+cf)%10).charAt(0));
                if(d1+cf>10) cf=1;
                else cf=0;

            }
        }
        if(cf!=0) o1.add(String.valueOf(1).charAt(0));
        for(int i=o1.size()-1;i>=0;i--){
            o2.add(o1.get(i));
        }
        return o2;
    }
    //    m为底数，r为指数 3 5(101)
    public static void main(String[] args) {

        new Main().solve();
    }
}
//p=1ll*n*(n-1)*(n-2)/6