#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> n >> t;
  unordered_map<string, int> us;
  int ct = 0, lp_size = 0;
  string ans = "", lp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int l = 0, r = s.length() - 1;
    string extra;
    for (int l = s.size() - 1; l >= 0; l--) {
      extra += s[l];
    }
    if (us.find(extra) == us.end()) {
      us.insert(make_pair(s, 1));
    } else {
      if (us[extra] == 1) {
        ans = extra + ans + s;
        ct += extra.length();
        us[extra] = 0;
      }
    }
  }
  for (auto i : us) {
    if (i.second == 1) {
      string extra;
      for (int l = i.first.size() - 1; l >= 0; l--) {
        extra += i.first[l];
      }
      if (extra == i.first) {
        if (extra.length() > lp.length()) {
          lp = extra;
          lp_size = extra.length();
        }
      }
    }
  }
  for (int i = 0; i < lp.length(); i++) {
    ans.insert(ans.begin() + ct + i, lp[i]);
  }
  cout << ans.length() << endl << ans;
  return 0;
}
