#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, g, fl = 0;
  cin >> n >> m;
  vector<string> s, sp, q;
  string p, e, z;
  for (i = 0; i < n; i++) {
    p.clear();
    cin >> p;
    e.clear();
    e = p;
    reverse(e.begin(), e.end());
    if (e == p)
      q.push_back(e);
    else
      s.push_back(p);
  }
  int count = 1, bl = 0;
  while (!s.empty()) {
    i = 0;
    bl = 0;
    count = 1;
    for (j = 0; j < s.size(); j++) {
      if (j == i) continue;
      if (s[i] == s[j]) {
        count++;
        s.erase(s.begin() + j);
      }
    }
    z.clear();
    z = s[i];
    reverse(z.begin(), z.end());
    for (j = 0; j < s.size(); j++) {
      if (s[j] == z) {
        bl++;
        s.erase(s.begin() + j);
      }
    }
    if (bl != 0) {
      if (bl < count) {
        for (j = 0; j < bl; j++) {
          sp.insert(sp.begin() + fl, z);
          fl++;
        }
        reverse(z.begin(), z.end());
        for (j = 0; j < bl; j++) sp.insert(sp.begin() + fl, z);
      } else {
        for (j = 0; j < count; j++) {
          sp.insert(sp.begin() + fl, z);
          fl++;
        }
        reverse(z.begin(), z.end());
        for (j = 0; j < count; j++) sp.insert(sp.begin() + fl, z);
      }
    }
    s.erase(s.begin() + i);
  }
  sort(q.begin(), q.end());
  int rep_count = 1, max = 1, result = 0, w;
  for (i = 1; i < q.size(); i++) {
    if (q[i] == q[i - 1])
      rep_count++;
    else
      rep_count = 1;
    if (rep_count > max) {
      result = i;
      max = rep_count;
    }
  }
  w = sp.size() / 2;
  if (!q.empty()) {
    for (i = 0; i < max; i++) sp.insert(sp.begin() + w, q[result]);
  }
  cout << sp.size() * m << endl;
  if (!sp.empty()) {
    for (i = 0; i < sp.size(); i++) cout << sp[i];
    cout << endl;
  }
  return 0;
}
