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.util.*;
import static java.lang.Math.*;

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;

public class A {
	static PrintWriter pw;
	static StringBuilder sb;
	static int inf = (int) 1e9;
	static long mod = (long) 1e9 + 7;
	static int[][] memo;
	static ArrayList<Integer> primes;
	static ArrayList<Integer>[] arr;
	static int n, k, m;
	static boolean[] vis;
	static boolean[] v;
	static HashSet<Integer> hs;
	static HashMap<Integer, Integer> hm;
	static HashSet<Integer> pr;
	static int[] ans, h1, h2;
	static int[] si;
	static int[] in;
	static HashMap<Integer, Integer> factors;
	static int[] fac, b;
	static int[] l, r;
	static int[] numc;
	static pair[] ed;
	static ArrayList<Integer>[] np;
	static TreeMap<pair, Integer> tm;
	static char[] h;
	static pair[] mm;
	static char[][] a;
	static char[] as = "IEHOVA#".toCharArray();

//	static ArrayList<Integer> primes;
	static int[] isComposite;

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}
// generated by sieve

	/*
	 * 1. Generating a list of prime factors of N
	 */
	static ArrayList<Integer> primeFactors(int N) // O(sqrt(N) / ln sqrt(N))
	{
		ArrayList<Integer> factors = new ArrayList<Integer>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			while (N % p == 0) {
				factors.add(p);
				N /= p;
			}
			p = primes.get(++idx);
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);
//		int t = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		String[] a = new String[n];
		String[] b = new String[n];
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < a.length; i++) {
			a[i] = br.readLine();
			b[i] = reverse(a[i]);
		}
		boolean[] arr = new boolean[n];
		for (int i = 0; i < b.length; i++) {
			boolean f = false;
			for (int j = i + 1; j < b.length; j++) {

				if (b[j].endsWith(a[i]) && !arr[j]) {
					arr[j] = true;
					f = true;
					break;
				}
			}
			if (f)
				sb.append(a[i]);
		}
		String add = "";
		int max = 0;
		for (int i = 0; i < arr.length; i++) {
			if (check(a[i]) && a[i].length() > max && !arr[i]) {
				max = a[i].length();
				add = a[i];
			}
		}
		String rev = reverse(sb.toString());
		pw.println(sb.length() * 2 + max);
		pw.println(sb + add + rev);
		pw.flush();
		pw.close();

	}

	static String reverse(String s) {
		StringBuilder sb = new StringBuilder();
		for (int i = s.length() - 1; i >= 0; i--)
			sb.append(s.charAt(i));
		return sb.toString();
	}

	static boolean check(String s) {
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i))
				return false;
		}
		return true;
	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;
		int w;

		public triple(int a, int b, int c, int d) {
			x = a;
			y = b;
			z = c;
			w = d;
		}

		@Override
		public int compareTo(triple o) {
			// TODO Auto-generated method stub
			return y - o.y;
		}
	}

	static long pow(long a, long e) // O(log e)
	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res *= a;
			a *= a;
			e >>= 1;
		}
		return res;
	}

	static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int l) {
			x = d;
			y = l;
		}

		@Override
		public int compareTo(pair arg0) {
			// TODO Auto-generated method stub
			if (x == arg0.x) {
				return (int) (y - arg0.y);
			}
			return x - arg0.x;
		}
	}

}
