#include <bits/stdc++.h>
using namespace std;
const int N = 102;
int n, m;
multiset<string> used;
string s[N], ans, mx;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    char x;
    for (int j = 0; j < m; j++) {
      scanf(" %c", &x);
      s[i] += x;
    }
    used.insert(s[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (used.find(s[i]) == used.end()) continue;
    string rs = s[i];
    reverse(rs.begin(), rs.end());
    used.erase(used.find(s[i]));
    if (used.find(rs) != used.end()) {
      ans += s[i];
      used.erase(used.find(rs));
    }
    if (s[i] == rs && s[i].length() > mx.length()) mx = s[i];
  }
  string rans = ans;
  reverse(rans.begin(), rans.end());
  ans += mx + rans;
  cout << ans.length() << endl;
  cout << ans << endl;
  return 0;
}
