#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v, rv;
  map<string, int> mp;
  string s, p, x, i = "", j = "";
  int a, b;
  cin >> a >> b;
  while (a--) {
    cin >> s;
    v.push_back(s);
    x = s;
    reverse(s.begin(), s.end());
    if (x == s) p = x;
    if (mp.count(s)) {
      i += x;
      j += x;
      mp[s]--;
    } else {
      mp[x]++;
    }
  }
  reverse(j.begin(), j.end());
  cout << i.size() + j.size() + p.size() << endl;
  cout << i << p << j << endl;
  return 0;
}
