#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  int i, j, li = 0, ri = 0;
  int x, y;
  string l[n * m], r[n * m];
  for (i = 0; i < n - 1; i++) {
    if (s[i] == "**") continue;
    for (j = i + 1; j < n; j++) {
      if (s[j] == "**") continue;
      x = 0;
      y = m - 1;
      while (x < m) {
        if (s[i][x] != s[j][y]) break;
        x++;
        y--;
      }
      if (x == m) {
        l[li] = s[i];
        r[ri] = s[j];
        s[i] = s[j] = "**";
        li++;
        ri++;
        break;
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] != "**") {
      x = 0;
      y = m - 1;
      while (x <= y) {
        if (s[i][x] != s[i][y]) break;
        x++;
        y--;
      }
      if (x > y) {
        l[li] = s[i];
        li++;
        break;
      }
    }
  }
  x = ri - 1;
  while (x >= 0) {
    l[li++] = r[x--];
  }
  cout << m * li << endl;
  for (i = 0; i < li; i++) cout << l[i];
  return 0;
}
