#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  string s[n], rs[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    rs[i] = s[i];
    reverse(rs[i].begin(), rs[i].end());
  }
  vector<string> f, b;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j != i) {
        if (s[i] == rs[j]) {
          f.push_back(s[i]);
          b.push_back(s[j]);
          s[i] = 'f';
          rs[j] = 'r';
          s[j] = 'f';
          rs[i] = 'r';
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == rs[i]) {
      f.push_back(s[i]);
      break;
    }
  }
  string ans = "";
  for (int i = 0; i < f.size(); i++) {
    ans += f[i];
  }
  for (int i = b.size() - 1; i >= 0; i--) {
    ans += b[i];
  }
  cout << ans.size() << endl;
  cout << ans << endl;
  return 0;
}
