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.*;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Contest {
	static ArrayList<Integer> prime=new ArrayList();
	/*public static void PrimeArray(int n)
	{
		for(int i=2;i<=n;i++)
		{
			boolean b=isprime(i);
			if(b)
			{
				prime.add(i);
			}
		}
	}
	*/
	
	public static long gcd(long n1, long n2)
    {
        if (n2 != 0)
            return gcd(n2, n1 % n2);
        else
            return n1;
    }
	
//////////////////	
	public static class trie {
        int x,y,z;
        trie (int x,int y,int z){
            this.x=x;
            this.y=y;
            this.z=z;
        }
	
	} 
        
	public static class pair {
        int x,y;
        pair (int x,int y){
            this.x=x;
            this.y=y;
        }
        public boolean equals(Object o) {
        	if(o instanceof pair) {
        		pair p = (pair)o;
        		return (x == p.x && y == p.y);
        	}
        	return false;
        }
        public int hashCode() {
        	return (Integer.hashCode(x) * 3 + Integer.hashCode(y) );
        }
    }
	
//////////////////	
	
	static class Cmp implements Comparator<pair>
	{
		public int compare(pair a,pair b)
		{
			if(a.x==b.x)
			{
				return(a.y-b.y);
			}
			return(a.x-b.x);
		}
	}
	
	
//////////////////
	
	
	
	
//////////////////
	
	
	
	
	
	   static class FastReader
	   {
		   BufferedReader br;
		   StringTokenizer st;
		   public FastReader()
		   {
			   br = new BufferedReader(new InputStreamReader(System.in));
		   }
		   
		   
		   String next() 
	        { 
	            while (st == null || !st.hasMoreElements()) 
	            { 
	                try
	                { 
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) 
	                { 
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken(); 
	        } 
		   
		   
		   int nextInt()
		   {
			   return Integer.parseInt(next());
		   }
		   long nextLong()
		   {
			   return Long.parseLong(next());
		   }
		   double nextDouble() 
	        { 
	            return Double.parseDouble(next()); 
	        } 
		   
		   String nextLine() 
	        { 
	            String str = ""; 
	            try
	            { 
	                str = br.readLine(); 
	            } 
	            catch (IOException e) 
	            { 
	                e.printStackTrace(); 
	            } 
	            return str; 
	        } 
	   }
	   
////////////////////// 
	//public static ArrayList<Integer> a=new ArrayList();
	   
	  public static long Divisors(long n) 
	   { 
	       // Note that this loop runs till square root 
		   long sum=0;
	       for (long i=1; i*i<=(n); i++) 
	       { 
	           if (n%i == 0) 
	           { 
	               // If divisors are equal, print only one 
	               if (n/i == i) 
	               {
	                  // printf("%d ", i); 
	            	   sum=sum+1;
	            	 //  a.add(i);
	               }
	     
	               else // Otherwise print both 
	               {
	                   //printf("%d %d ", i, n/i); 
	            	   sum=sum+2;
	            	  // a.add(i);
	            	   //a.add(n/i);
	               }
	           } 
	       } 
	       return(sum);
	   } 
	   
/////////////////////	  
	  
	  public static long SmallestPrimeDivisor(long n) 
	  { 
	      // if divisible by 2 
	      if (n % 2 == 0) 
	          return 2; 
	    
	      // iterate from 3 to sqrt(n) 
	      for (long i = 3; i * i <= n; i += 2) { 
	          if (n % i == 0) 
	              return i; 
	      } 
	    
	      return n; 
	  } 
	    
////////////////////	  
	   
	   public static boolean isprime(long n)
	    {
	        int count=0;
	     
	        for(long i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                return(false);
	            }
	        }
	        return(true);
	    }
	
	   
//////////////////////
	   
	     //   (x^n)%1000000007
	   public static long modularExponentiation(long x,long n,long M)
	   {
	       if(n==0)
	           return 1;
	       else if(n%2 == 0)        //n is even
	           return modularExponentiation((x*x)%M,n/2,M);
	       else                             //n is odd
	           return (x*modularExponentiation((x*x)%M,(n-1)/2,M))%M;

	   }
	   
	   public static long nCr(int n,int k)
	   {
		  if(k==0)
			  return 1;
		  return(n*nCr(n-1,k-1)/k);
	   }
	   public static long factorial(int n)
	   {
		   if(n==1)
			   return 1;
		   return((n%1000000007)*factorial(n-1));
	   }
	   
	   public static void debug(Object...o) {
		    System.out.println( Arrays.deepToString(o) );
	   }
	   
	   
	 
	   
	   
	   
	   
	   

		public static void main(String []args) throws Exception
		{
			
			
			 FastReader in =new FastReader();	
			 PrintWriter pw = new PrintWriter(System.out);
		    //Scanner sc=new Scanner(System.in)
			// int x=in.nextInt();
			 
			 int n=in.nextInt();
			 int m=in.nextInt();
			 String s1="";
			 int k1=0;
			 ArrayList<String> a=new ArrayList();
			 ArrayList<String> b=new ArrayList();
			 ArrayList<String> c=new ArrayList();
			 ArrayList<String> d=new ArrayList();
			 HashMap<String,Integer> h=new HashMap();
			 for(int i=0;i<n;i++)
			 {
				 StringBuffer s=new StringBuffer(in.nextLine());
				 a.add(s.toString());
				 b.add(s.reverse().toString());
				 
			 }
			
			 for(int i=0;i<n;i++)
			 {
				 if(a.get(i).equals(b.get(i)))
				 {
					//h.put(a.get(i), h.getOrDefault(a.get(i),0)+1);
					s1=a.get(i);
					break;
				 }
			 }
			
			 for(int i=0;i<n;i++)
			 {
				 for(int j=0;j<n;j++)
				 {
					 if(i!=j)
					 {
						 if(b.get(i).equals(a.get(j)))
						 {
							 c.add(a.get(i));
							 d.add(a.get(j));
							 k1++;
							 a.set(j,Integer.toString(k1));
							 a.set(i,"$");
							 // pw.println("a is "+a);
							 //pw.println("b is "+b);
							 //pw.println("c is "+c);
							 //pw.println("d is "+d);
							 break;
						 }
					 }
				 }
			 }
			// pw.println(a);
			 //pw.println(b);
			 //pw.println(c);
			 //pw.println(d);
			 int size=2*k1*m+s1.length();
			 pw.println(size);
			 if(size==0)
			 {
				 pw.println("");
			 }
			 else
			 {
			 for(int i=0;i<k1;i++)
			 {
				 pw.print(c.get(i));
			 }
			 pw.print(s1);
			 for(int i=k1-1;i>=0;i--)
			 {
				 pw.print(d.get(i));
			 }
			 }
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 
			 /*
			 
			 
			 
			 
			 
			 
			 
			 int t=in.nextInt();
			 while(t-->0)
			 {
				 int n=in.nextInt();
				 int m=in.nextInt();
				 int min=m,max=m,pre=0,m1=0;
				 for(int i=0;i<n;i++)
				 {
					 int a=in.nextInt();
					 int b=in.nextInt();
					 int c=in.nextInt();
					 pre=a-pre;
					 min=min-pre;
					 max=max+pre;
					 if( (min<b&& max<b)  || (min>c&& max>c) )
					 {
						 m1=1;
						 break;
						
					 }
					 else
					 {
						 min=b;
						 max=c;
						 
					 }

				 }
				 if(m1==1)
				 {
					 pw.println("NO");
				 }
				 else
				 {
					 pw.println("YES");
				 }
			 }
			 
		     	
		     		  
		     		  
		     		  
		     		  
		     		  
		     		  
		     		  
		     		  
		     		  
		     */		  
		     		  
		     		  
	        pw.flush();
			pw.close();
			
			
		}
			
	}	
		
		
		
		
		
		
		
		
		
		
	

