#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, flag = 0, counter = 0;
  cin >> n >> m;
  vector<int> same;
  vector<int> diffasc, diffdesc;
  string s[n], stri = "";
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < n; ++i) {
    stri = s[i];
    reverse(stri.begin(), stri.end());
    if (stri == s[i] && flag == 0) {
      same.push_back(i);
      counter++;
      flag = 1;
      continue;
    }
    for (int j = i + 1; j < n; ++j) {
      if (s[j] == stri) {
        diffasc.push_back(i);
        diffdesc.push_back(j);
        counter += 2;
      }
    }
  }
  cout << (counter * m) << endl;
  if (counter == 0) exit(0);
  if (!diffasc.empty()) {
    for (int i = 0; i < diffasc.size(); ++i) cout << s[diffasc[i]];
  }
  if (!same.empty()) cout << s[same[0]];
  if (!diffdesc.empty()) {
    for (int i = diffdesc.size() - 1; i >= 0; --i) cout << s[diffdesc[i]];
  }
  return 0;
}
