#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> p, q;
int reverse(string a, string b) {
  int i = 0, j = m - 1, x = 1;
  while (i < m) {
    if (a[i] != b[j]) {
      x = -1;
      break;
    }
    i++;
    j--;
  }
  return x;
}
int palin(string a) {
  int x = 1;
  for (int i = 0; i < m / 2; i++) {
    if (a[i] != a[m - i - 1]) {
      x = -1;
      break;
    }
  }
  return x;
}
int main() {
  cin >> n >> m;
  string s[n];
  int x[n], sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    x[i] = 0;
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (x[i] == 0 && x[j] == 0) {
        if (reverse(s[i], s[j]) == 1) {
          p.push_back(i);
          q.push_back(j);
          x[i] = 1;
          x[j] = 1;
          sum = sum + 2 * m;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (x[i] == 0) {
      if (palin(s[i]) == 1) {
        p.push_back(i);
        x[i] = 1;
        sum += m;
        break;
      }
    }
  }
  cout << sum << endl;
  for (int i = 0; i < p.size(); i++) {
    cout << s[p[i]];
  }
  for (int i = q.size() - 1; i >= 0; i--) {
    cout << s[q[i]];
  }
  cout << endl;
}
