#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> v;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  deque<string> d;
  string mid = "";
  for (int i = 0; i < n; i++) {
    s = v[i];
    string revS = s;
    reverse(revS.begin(), revS.end());
    auto it = find(v.begin() + i, v.end(), revS);
    if (it != v.end()) {
      if (*it == s) {
        mid = s;
        continue;
      }
      d.push_back(s);
      d.push_front(revS);
      v[i] = "";
    }
  }
  int length = 0;
  if (mid.size() > 0) {
    length = m;
  }
  for (int i = 0; i < d.size() / 2; i++) {
    mid = d[i] + mid;
    mid += d[d.size() - i - 1];
  }
  length += d.size() * m;
  cout << length << "\n";
  cout << mid << "\n";
}
