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.


/*
 -> Written by <-
   -----------
  |J_O_B_E_E_L|
  |___________|
  |    ___    |
  |   (^_^)   |
  |  /( | )\  |
  |____|_|____|
*/
import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.Map.*;

public class Test {
    static  PrintWriter pw=new PrintWriter(System.out);
    static  HashSet<Integer>[] set=new HashSet[27];
    static  boolean [] visited;
    static  StringBuilder sb;
    static  void dfs(int u){
        visited[u]=true;
        sb.append((char)(u+'a'));
        for(int v:set[u])
            if(!visited[v]) dfs(v);
    }
    static String  reverse(String st){
        StringBuilder sb=new StringBuilder();
        for(int i=st.length()-1;i>=0;i--)sb.append(st.charAt(i));
        return sb.toString();
    }
    static  boolean isPalindrom(String x){
        int len=x.length()>>1;
        for(int i=0;i<len;i++)
            if(x.charAt(i)!=x.charAt(x.length()-i-1)) return  false;
        return  true;
    }
    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt(); int x=sc.nextInt();
        TreeMap<String,Integer> map=new TreeMap<>();
        while(t-->0) {
            String y=sc.next();
            int b=map.getOrDefault(y,0);
            map.put(y,b+1);
        }
        int count=0;
        int size=0;
        LinkedList<String>list=new LinkedList<>();
        while(!map.isEmpty()){
            Entry<String,Integer>entry=map.pollFirstEntry();
            String key=entry.getKey();
            int value=entry.getValue();
            String rev=reverse(key);
            if(map.containsKey(rev)){
                Entry<String,Integer>entry2=map.ceilingEntry(rev);
                //pw.println(entry2);
                int min=Math.min(value,entry2.getValue());
                for(int i=0;i<min;i++){
                    size+=(x<<1);
                    list.addFirst(key);
                    list.addLast(entry2.getKey());
                }
                map.remove(rev);
            }else{
                if(count<1 && isPalindrom(key)){
                    count++;
                    LinkedList<String> list2=new LinkedList<>();
                    list2.add(key);
                    size+=x;
                    while(!list.isEmpty()){
                        list2.addFirst(list.pollFirst());
                        list2.addLast(list.pollLast());
                    }
                    list=list2;
                }
            }
        }
        pw.println(size);
        for(String z:list)pw.print(z);
        pw.flush();
        pw.close();
    }
    static class Node{
        Node next,previous;
        char data;
        public Node(char x){
            data=x;
            previous=next=null;
        }
        public String toString(){
            return ""+data;
        }
    }
    static  class pair implements Comparable <pair>{
        int x,y;
        public pair(int x,int y){this.x=x; this.y=y;}

        public int compareTo(pair o) {
            if(x==o.x) return  y-o.y;
            return  x-o.x;
        }
    }

    static class Scanner {

        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int curbuf;
        private int lenbuf;

        public Scanner(InputStream in) {
            this.in = in;
            this.curbuf = this.lenbuf = 0;
        }

        public boolean hasNextByte() {
            if (curbuf >= lenbuf) {
                curbuf = 0;
                try {
                    lenbuf = in.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0)
                    return false;
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[curbuf++];
            else
                return -1;
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private void skip() {
            while (hasNextByte() && isSpaceChar(buffer[curbuf]))
                curbuf++;
        }

        public boolean hasNext() {
            skip();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (!isSpaceChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            if (!hasNext())
                throw new NoSuchElementException();
            int c = readByte();
            while (isSpaceChar(c))
                c = readByte();
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = readByte();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res = res * 10 + c - '0';
                c = readByte();
            } while (!isSpaceChar(c));
            return (minus) ? -res : res;
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            int c = readByte();
            while (isSpaceChar(c))
                c = readByte();
            boolean minus = false;
            if (c == '-') {
                minus = true;
                c = readByte();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res = res * 10 + c - '0';
                c = readByte();
            } while (!isSpaceChar(c));
            return (minus) ? -res : res;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

    }

}