#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  int m;
  cin >> n >> m;
  vector<string> ans;
  string a;
  string res = "";
  for (int i = 0; i < n; i++) {
    cin >> a;
    ans.push_back(a);
  }
  int flag = 0;
  string q = "";
  int count = 0;
  for (int i = 0; i < n; i++) {
    string y = ans[i];
    reverse(y.begin(), y.end());
    if (ans[i].compare(y) == 0 && flag == 0) {
      q = ans[i];
      flag = 1;
      break;
    }
  }
  string res2 = "";
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      string a1 = ans[j];
      reverse(a1.begin(), a1.end());
      if (ans[i].compare(a1) == 0) {
        res = res + ans[i];
        res2 = ans[j] + res2;
        count = count + 2;
      }
    }
  }
  if (count == 0 && q.length() == 0) {
    cout << "0\n";
  } else if (count == 0) {
    cout << q.length() << "\n";
    cout << q << "\n";
  } else if ((res.length() + res2.length()) % count == 0) {
    res = res + q + res2;
    cout << res.length() << "\n";
    cout << res << "\n";
  } else {
    res = res + res2;
    cout << res.length() << "\n";
    cout << res << "\n";
  }
  return 0;
}
