#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, l;
  cin >> n >> m;
  string s[n], temp, rev, sd, ans;
  for (i = 0; i < n; ++i) cin >> s[i];
  for (i = 0; i < n; ++i) {
    for (j = n - 1; j > i; --j) {
      rev = s[j];
      reverse(rev.begin(), rev.end());
      if (s[i] == rev) {
        ans += s[i];
        temp += rev;
        break;
      }
    }
  }
  for (i = 0; i < n; ++i) {
    sd = s[i];
    reverse(sd.begin(), sd.end());
    if (s[i] == sd) {
      ans += s[i];
      break;
    }
  }
  reverse(temp.begin(), temp.end());
  ans += temp;
  cout << ans.size() << "\n";
  cout << ans << "\n";
}
