#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926535897932384626;
bool check(string &w) {
  string v = w;
  reverse(v.begin(), v.end());
  return (v == w);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  vector<string> bag;
  set<long long> av;
  for (long long i = 0; i < n; i++) {
    av.insert(i);
    string ss;
    cin >> ss;
    bag.emplace_back(ss);
  }
  string pre("");
  string suf("");
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      string x = bag[i];
      string y = bag[j];
      reverse(y.begin(), y.end());
      if (x == y) {
        reverse(y.begin(), y.end());
        pre = pre + x;
        suf = y + suf;
        av.erase(av.find(i));
        av.erase(av.find(j));
      }
    }
  }
  string centre("");
  for (auto &lol : av) {
    string z = bag[lol];
    if (check(z)) {
      centre = z;
      break;
    }
  }
  if (centre == "") {
    pre += suf;
    cout << (pre.size()) << endl;
    cout << pre << endl;
    return 0;
  }
  pre += centre;
  pre += suf;
  cout << (pre.size()) << endl;
  cout << pre << endl;
  return 0;
}
