#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
bool isPali(string str) {
  int l = 0;
  int h = str.size() - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      return false;
    }
  }
  return true;
}
void solve() {
  int n, m;
  cin >> n >> m;
  string s[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  map<string, string> pat;
  string center = "";
  for (int i = 1; i <= n; i++) {
    bool flag = 1;
    for (int j = i + 1; j <= n; j++) {
      string x = s[i];
      string y = s[j];
      if (isPali(x + y)) {
        pat[x] = y;
        flag = 0;
      }
    }
    if (flag == 1) {
      if (isPali(s[i])) center = s[i];
    }
  }
  for (auto e : pat) {
    center = e.first + center + e.second;
  }
  if (center.length() == 0)
    cout << 0 << endl;
  else
    cout << center.length() << endl << center;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
    cout << endl;
  }
  return 0;
}
