#include <bits/stdc++.h>
using namespace std;
bool isPalin(string s) {
  int sz = s.size();
  for (int i = 0; i < sz; i++) {
    if (s[i] != s[sz - 1 - i]) return false;
  }
  return true;
}
bool arePalin(string s1, string s2) { return isPalin(s1 + s2); }
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> pal1;
  vector<string> pal2;
  vector<string> palin;
  vector<string> v(n, "");
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) {
    if (isPalin(v[i])) palin.push_back(v[i]);
    for (int j = 0; j < i; j++) {
      if (arePalin(v[i], v[j])) {
        pal1.push_back(v[i]);
        pal2.push_back(v[j]);
      }
    }
  }
  cout << m * (2 * pal1.size() + ((palin.size()) ? 1 : 0)) << endl;
  string ans = "";
  for (int i = 0; i < (int)pal1.size(); i++) ans += pal1[i];
  if (palin.size()) ans += palin[0];
  for (int i = pal2.size() - 1; i >= 0; i--) ans += pal2[i];
  cout << ans << endl;
}
