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.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;


public class Main {

    static void solve() {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m= scan.nextInt();
        Set<String>set = new HashSet<>();
        Stack<String> q = new Stack<>();
        StringBuilder sb = new StringBuilder();
        String selfPal = "";
        for(int i=0;i<n;i++) {
            String s = scan.next();
            if(isPal(s)) {
                selfPal = s;
                continue;
            }
            set.add(s);
            String pal = getPalindrome(s);
            if(set.contains(pal)) {
                sb.append(pal);
                q.add(s);
            }
        }
        sb.append(selfPal);
        while(!q.isEmpty()) {
            sb.append(q.pop());
        }
        System.out.println(sb.length());
        System.out.println(sb.toString());
    }

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

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


    public static void main(String[] args) {

        solve();

        //        Main m = new Main();
        //        Scanner scan = new Scanner(System.in);

        //        long n = scan.nextLong();
        //        long r = scan.nextLong();
        //        List<Long> list = new ArrayList<>();
        ////        int[] arr = new int[n];
        //        for (long i=0;i<n;i++){
        //            list.add(scan.nextLong());
        //        }
//            System.out.println(ch);
        //        solve(n, arr);
        //        scan.close();
    }


    class Counter extends HashMap<Integer, Integer> {
        public int get(int k) {
            return containsKey(k) ? super.get(k) : 0;
        }

        public void add(int k, int v) {
            put(k, get(k) + v);
        }
    }

    static class LRUCache {
        Map<Integer, Node> map;
        Node front;
        Node tail;
        int capacity;

        public LRUCache(int capacity) {
            map = new HashMap<>(capacity);
            this.capacity = capacity;
        }

        public int get(int key) {
            if (!map.containsKey(key)) {
                return -1;
            }
            Node node = map.get(key);
            if (node == front) {
                return front.data;
            }
            if (node == tail) {
                tail = node.prev;
            }
            front.prev = node;
            node.prev.next = node.next;
            if (node.next != null) {
                node.next.prev = node.prev;
            }
            node.next = front;
            node.prev = null;
            front = node;

            return front.data;
        }

        public void put(int key, int value) {
            Node node = new Node(key, value);
            ;
            if (front == null) {
                front = node;
                tail = node;
                map.put(key, node);
                return;
            }
            if (map.containsKey(key)) {
                node = map.get(key);
                node.data = value;
                if (node == front) {
                    map.put(key, node);
                    return;
                }
                if (node == tail) {
                    tail = node.prev;
                }
                front.prev = node;
                node.prev.next = node.next;
                if (node.next != null) {
                    node.next.prev = node.prev;
                }
                node.next = front;
                node.prev = null;
                front = node;
                map.put(key, node);
            } else if (map.size() < capacity) {
                front.prev = node;
                node.next = front;
                node.prev = null;
                front = node;
                map.put(key, node);

            } else {
                //remove a tail, insert to front
                map.remove(tail.key);
                if (tail.prev != null) {
                    tail.prev.next = null;
                }
                tail = tail.prev;

                front.prev = node;
                node.next = front;
                node.prev = null;
                front = node;
                map.put(key, node);
            }
        }
    }

    static class Node {
        int key;
        int data;
        Node next;
        Node prev;

        Node(int key, int data) {
            this.key = key;
            this.data = data;
        }
    }

    static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    static class Trie {
        void add(String word) {

        }

        boolean search(String w) {
            return false;
        }
    }

    static class Node1 {
        public int val;
        public List<Node1> children;

        public Node1() {
        }

        public Node1(int _val, List<Node1> _children) {
            val = _val;
            children = _children;
        }
    }

    ;

    static class TrieNode {

    }

    static class KvNode implements Comparable<KvNode> {
        String key;
        int freq;

        public KvNode(String key, int freq) {
            this.key = key;
            this.freq = freq;
        }

        @Override
        public int compareTo(KvNode o) {
            if (this.key.equals(o.key)) {
                return 0;
            }
            return Integer.compare(o.freq, this.freq);
        }
    }

    static class ListNode {
        int val;
        ListNode next;

        ListNode(int x) {
            val = x;
        }
    }
}
