#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
long long n, m, vis[200], ct, ct2;
string s[200];
string r1[200], r2[200];
string h[200];
void cp(string a, string b, long long x, long long y) {
  long long jg = 1;
  for (long long i = 0, j = m - 1; i < m; i++, j--) {
    if (a[i] != b[j]) {
      jg = 0;
      break;
    }
  }
  if (jg) {
    ct++;
    vis[x] = 1;
    vis[y] = 1;
    r1[ct] = a;
    r2[ct] = b;
  }
  return;
}
signed main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> s[i];
  }
  ct = 0;
  for (long long i = 1; i <= n; i++) {
    if (vis[i]) {
      continue;
    }
    for (long long j = i + 1; j <= n; j++) {
      if (vis[i]) {
        break;
      }
      if (vis[j]) {
        continue;
      }
      cp(s[i], s[j], i, j);
    }
  }
  ct2 = 0;
  for (long long i = 1; i <= n; i++) {
    if (vis[i]) {
      continue;
    }
    long long jg = 1;
    for (long long x = 0, y = m - 1; x < m / 2; x++, y--) {
      if (s[i][x] != s[i][y]) {
        jg = 0;
        break;
      }
    }
    if (jg) {
      ct2++;
      h[ct2] = s[i];
    }
  }
  long long co = ct * m * 2;
  if (ct2 > 0) {
    co = co + m;
  }
  cout << co << endl;
  for (long long i = 1; i <= ct; i++) {
    cout << r1[i];
  }
  if (ct2 > 0) {
    cout << h[1];
  }
  for (long long i = ct; i >= 1; i--) {
    cout << r2[i];
  }
}
