#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string str) {
  long long l = 0;
  long long h = str.length() - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      return false;
    }
  }
  return true;
}
int32_t main() {
  long long n{}, m{};
  cin >> n >> m;
  vector<string> v(n);
  long long d{};
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long c{};
  string start = "", end = "";
  for (long long i = 0; i < n; i++) {
    if (v[i] == "fuck" || v[i] == "off") {
      continue;
    }
    string str = v[i];
    reverse(str.begin(), str.end());
    for (long long j = 0; j < n; j++) {
      if ((v[j] == str) and i != j) {
        c++;
        start += v[i];
        string temp = v[j];
        temp += end;
        end = temp;
        v[i] = "fuck";
        v[j] = "off";
        break;
      }
    }
  }
  string mid = "";
  for (long long i = 0; i < v.size(); i++) {
    if (isPalindrome(v[i])) {
      d++;
      mid += v[i];
      break;
    }
  }
  long long ans = c * m * 2;
  if (d > 0) {
    ans += m;
  }
  cout << ans << endl;
  cout << start << mid << end << endl;
  return 0;
}
