#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mp;
  int n, m;
  cin >> n >> m;
  string s[n + 2];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    mp[s[i]]++;
  }
  string left, mid;
  for (int i = 0; i < n; i++) {
    string t = s[i];
    reverse(t.begin(), t.end());
    if (mp[t] != 0 && t != s[i] || t == s[i] && mp[t] > 2) {
      left += s[i];
      mp[s[i]]--;
      mp[t]--;
    } else if (t == s[i] && mp[t] == 1) {
      mid = t;
    }
  }
  cout << left.size() * 2 + mid.size() << endl;
  cout << left;
  cout << mid;
  reverse(left.begin(), left.end());
  cout << left << endl;
}
