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.
#include <bits/stdc++.h>
using namespace std;
long long t, n, m, k, d, e, q, b, c, bo, r, l, h, i, j, mm, kk, jj, w, x, y, g,
    a, mod = 1e9 + 7, z, ax, bx, ay, by, xx, yy;
vector<long long> v, vv;
pair<long long, long long> p[1000001];
map<long long, long long> mp, mpp, vis, mpx, mpy;
set<long long> se;
string s[1000001], second, sss;
char cc;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    b = 1;
    for (j = 1; j < m; j++) {
      if (s[i][j] != s[i][m - j - 1]) b = 0;
    }
    mp[i] = b;
    a = max(b, a);
  }
  for (i = 0; i < n; i++) {
    if (mpp[i] == 0) {
      for (j = i + 1; j < n; j++) {
        if (mpp[j] == 0) {
          b = 0;
          for (k = 0; k < m; k++) {
            if (s[i][k] != s[j][m - k - 1]) b = 1;
          }
          if (b == 0) {
            second += s[i];
            sss = s[j] + sss;
            mpp[i] = 1;
            mpp[j] = 1;
            break;
          }
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (mp[i] == 1 && mpp[i] == 0) {
      second += s[i];
      break;
    }
  }
  z = second.size() + sss.size();
  cout << z << endl;
  cout << second << sss;
  return 0;
}
