#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  long long op1 = abs(a.first) + abs(a.second);
  long long op2 = abs(b.first) + abs(b.second);
  return op1 < op2;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    vector<string> left, right;
    string mid = "";
    long long n, m;
    cin >> n >> m;
    set<string> dict;
    vector<string> v(n);
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      dict.insert(v[i]);
    }
    long long middle = 0;
    for (long long i = 0; i < n; i++) {
      string s = v[i];
      reverse((v[i]).begin(), (v[i]).end());
      if (s == v[i]) {
        middle = m;
        mid = s;
      } else {
        if (dict.count(s) && dict.count(v[i])) {
          left.push_back(s);
          right.push_back(v[i]);
          dict.erase(s);
          dict.erase(v[i]);
        }
      }
    }
    long long sz = left.size();
    cout << 2 * sz * m + middle << "\n";
    for (string x : left) {
      cout << x;
    }
    cout << mid;
    while (!right.empty()) {
      cout << right.back();
      right.pop_back();
    }
  }
  return 0;
}
