#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> v;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  string res, left, right, mid;
  int count = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      string t1 = v[i];
      string t2 = v[j];
      reverse(t2.begin(), t2.end());
      if (t1 == t2) {
        left += t1;
        right = v[j] + right;
      }
    }
  }
  bool flag = false;
  for (int i = 0; i < n; i++) {
    string t = v[i];
    reverse(t.begin(), t.end());
    if (t == v[i] && !flag) {
      mid += t;
      flag = true;
    }
  }
  res = left + mid + right;
  cout << res.size() << "\n" << res << "\n";
  return 0;
}
