#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, cnt = 0, f = 0;
  cin >> n >> m;
  string s, ans, rans, ss;
  vector<string> v, rv;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
    reverse(s.begin(), s.end());
    rv.push_back(s);
    if (v[i] == rv[i]) {
      f = 1;
      ss = v[i];
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (j == i) continue;
      if (v[i] == rv[j]) {
        cnt += 2 * m;
        ans += v[i];
        rans = v[j] + rans;
        v[j] = "";
        v[i] = "";
      }
    }
  }
  if (f) {
    cnt += m;
    ans += ss;
  }
  cout << cnt << '\n' << ans + rans;
  return 0;
}
