#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  string ans, ans1;
  map<int, int> ma;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ma.find(j) == ma.end()) {
        reverse(s[j].begin(), s[j].end());
        if (s[i] == s[j]) {
          ma[j] = 1;
          ma[i] = 1;
          ans += s[j];
        }
        reverse(s[j].begin(), s[j].end());
      }
    }
  }
  ans1 = ans;
  for (int i = 0; i < n; i++) {
    if (ma.find(i) == ma.end()) {
      int flag = 0, st = 0, en = m - 1;
      while (st < en) {
        if (s[i][st] != s[i][en]) flag = 1;
        st++;
        en--;
      }
      if (flag == 0) {
        ans += s[i];
        break;
      }
    }
  }
  reverse(ans1.begin(), ans1.end());
  ans += ans1;
  cout << ans.size() << endl;
  cout << ans << endl;
}
