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

public class Level {

    public static DS.Scanner in = new DS.Scanner();

    public static void d(String[] z, boolean[] v) {
        for (int i = 0; i < z.length; i++) {
            String a = z[i];
            String b = new StringBuilder(a).reverse().toString();
            for (int j = 0; j < z.length; j++) {
                if (i != j) {
                    if (z[j].equals(b)) {
                        v[i] = true;
                        v[j] = true;
                    }
                }
            }
        }
    }

    public static boolean pal(String a) {
        String b = new StringBuilder(a).reverse().toString();
        if (a.equals(b)) {
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<String>();
        LinkedList<String> pals = new LinkedList<String>();
        int n = in.nextInt();
        int m = in.nextInt();
        String[] z = new String[n];
        boolean[] v = new boolean[z.length];
        for (int i = 0; i < z.length; i++) {
            z[i] = in.next();
        }
        d(z, v);
        boolean f = false;
        for (int i = 0; i < v.length; i++) {
            if (v[i]) {
                list.add(z[i]);
            } else if (pal(z[i]) && !f) {
                v[i] = true;
                f = true;
                pals.add(z[i]);
            }
        }
        LinkedList<String> sol = new LinkedList<String>();
        if (pals.size() > 0) {
            sol.add(pals.get(0));
        }
        for (int i = 0; i < list.size(); i++) {
            String cur = list.get(i);
            String rev = new StringBuilder(cur).reverse().toString();
            if (!sol.contains(cur)) {
                sol.addFirst(cur);
                sol.addLast(rev);
            }
        }
        StringBuilder b = new StringBuilder();
        for (String cv : sol) {
            b.append(cv);
        }
        System.out.println(b.length());
        System.out.println(b.toString());
        /*  for (String h : list) {
            System.out.println(h);
        }
        System.out.println(pals.size());*/
    }

    public static class Algo {

        public static int lowerBound(ArrayList<Integer> list, int length, int value) {
            int low = 0;
            int high = length;
            while (low < high) {
                final int mid = (low + high) / 2;
                if (value <= list.get(mid)) {
                    high = mid;
                } else {
                    low = mid + 1;
                }
            }
            return low;
        }

        public static int upperBound(ArrayList<Integer> list, int length, int value) {
            int low = 0;
            int high = length;
            while (low < high) {
                final int mid = (low + high) / 2;
                if (value >= list.get(mid)) {
                    low = mid + 1;
                } else {
                    high = mid;
                }
            }
            return low;
        }

        public static void merge(int arr[], int l, int m, int r) {
            int n1 = m - l + 1;
            int n2 = r - m;

            int L[] = new int[n1];
            int R[] = new int[n2];

            for (int i = 0; i < n1; ++i) {
                L[i] = arr[l + i];
            }
            for (int j = 0; j < n2; ++j) {
                R[j] = arr[m + 1 + j];
            }

            int i = 0, j = 0;

            int k = l;
            while (i < n1 && j < n2) {
                if (L[i] <= R[j]) {
                    arr[k] = L[i];
                    i++;
                } else {
                    arr[k] = R[j];
                    j++;
                }
                k++;
            }

            while (i < n1) {
                arr[k] = L[i];
                i++;
                k++;
            }

            while (j < n2) {
                arr[k] = R[j];
                j++;
                k++;
            }
        }

        public static void sort(int arr[], int l, int r) {
            if (l < r) {
                int m = (l + r) / 2;

                sort(arr, l, m);
                sort(arr, m + 1, r);

                merge(arr, l, m, r);
            }
        }

        public static ArrayList<Integer> sieve(int n) {
            long sqr = (long) Math.sqrt(n);
            boolean[] isPrime = new boolean[n + 1];
            for (int i = 0; i <= n; i++) {
                isPrime[i] = true;
            }
            for (int i = 2; i <= sqr; i++) {
                if (isPrime[i]) {
                    for (int p = i * i; p <= n; p += i) {
                        isPrime[p] = false;
                    }
                }
            }
            ArrayList<Integer> list = new ArrayList<Integer>();
            for (int i = 0; i <= n; i++) {
                if (isPrime[i]) {
                    list.add(i);
                }
            }
            list.remove(0);
            list.remove(0);
            return list;
        }

        public static boolean isPrime(long n) {
            boolean res = true;
            List l = sieve((int) Math.sqrt(n));
            for (int i = 0; i < l.size(); i++) {
                int curPrime = (int) l.get(i);
                if (n % curPrime == 0) {
                    res = false;
                    break;
                }
            }
            return res;
        }

        public static ArrayList factorizatin(int n) {

            ArrayList<Integer> list = new ArrayList<Integer>();
            if (n == 1) {
                list.add(1);
                return list;
            } else if (n == 2) {
                list.add(2);
                return list;
            } else {
                if (isPrime(n)) {
                    System.out.println(-1);
                    return null;
                } else {
                    Iterator ptr = sieve((int) Math.sqrt(n)).iterator();
                    if (ptr.hasNext()) {
                        int cur = (int) ptr.next();
                        // System.out.println(cur);
                        while (n != 1) {
                            System.out.println(n);
                            while (n % cur == 0) {
                                list.add(cur);
                                n /= cur;
                            }
                            if (ptr.hasNext()) {
                                cur = (int) ptr.next();
                            }
                            //System.out.println(cur);
                        }
                    }
                    if (n > 2) {
                        list.add(n);
                    }
                }
                return list;
            }
        }

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

        public static long lcm(long a, long b) {
            long ab = a * b;
            long gcd = gcd(a, b);
            return ab / gcd;
        }

        public static int bs(int[] z, int k) {
            int res = 0;
            int l = 0;
            int r = z.length - 1;
            int mid = (l + r) / 2;
            while (l <= r) {

                if (z[mid] == k) {
                    res = 1;
                    break;
                }
                if (z[mid] > k) {
                    r = mid - 1;
                } else {
                    l = mid + 1;
                }
                mid = (l + r) / 2;
            }
            return res;
        }

        public static void solve() {
            int n = Integer.parseInt(in.next());
            int target = Integer.parseInt(in.next());
            int[] z = new int[n];
            for (int i = 0; i < n; i++) {
                z[i] = Integer.parseInt(in.next());
            }
            Arrays.sort(z);
            int ptr1 = 0;
            int ptr2 = n - 1;
            int wind = z[ptr1] + z[ptr2];
            if (wind == target) {
                System.out.println(ptr1 + "-" + ptr2);
            } else {
                while (ptr1 < ptr2 && wind != target) {
                    if (wind > target) {
                        wind -= z[ptr2--];
                        wind += z[ptr2];
                    } else {
                        wind -= z[ptr1++];
                        wind += z[ptr1];
                    }
                }
                if ((ptr1 != 0 || ptr2 != n - 1) && ptr2 != ptr1) {
                    System.out.println(ptr1 + "-" + ptr2);
                } else {
                    System.out.println(-1);
                }
            }
        }

        public static void sliding() {
            int n = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int[] z = new int[n];
            for (int i = 0; i < n; i++) {
                z[i] = Integer.parseInt(in.next());
            }
            int wind = 0;
            for (int i = 0; i < k; i++) {
                wind += z[i];
            }
            int max = wind;
            for (int i = k; i < n; i++) {
                wind += z[i];
                wind -= z[i - k];
                max = Math.max(max, wind);
            }
            System.out.println(max);
        }

        public static ArrayList<Integer> dd(int n) {
            ArrayList<Integer> list = new ArrayList<Integer>();
            HashSet<Integer> set = new HashSet<Integer>();
            for (int i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    set.add(n / i);
                    set.add(i);
                }
            }
            Iterator<Integer> ptr = set.iterator();
            while (ptr.hasNext()) {
                list.add(ptr.next());
            }
            return list;
        }
    }

    private static class DS {

        private static class Stack {

            private int Size;
            Node top;
            Node last;

            Stack() {

                Size = 0;
                top = null;
                last = null;
            }

            public int size() {
                return this.Size;
            }

            public void push(Object item) {
                Node node = new Node();
                node.data = item;
                node.next = top;
                top = node;
                Size++;
            }

            public void pop() {
                if (top != null) {
                    top = top.next;
                }
                Size--;
            }

            public boolean isEmpty() {
                return top == null;
            }

            public Object getTop() {
                if (top != null) {
                    return top.data;
                } else {
                    return null;
                }
            }

            public void display() {
                if (top != null) {
                    Node temp = top;
                    while (temp != null) {
                        System.out.print(temp.data + " ");
                        temp = temp.next;
                    }
                    System.out.println();
                }
            }

            private class Node {

                Object data;
                Node next;
            }
        }

        private static class Scanner {

            BufferedReader br;
            StringTokenizer st;

            public Scanner() {
                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;
            }

            BigInteger nextBigInteger() {
                return new BigInteger(next());
            }

        }
    }

}
