#include <bits/stdc++.h>
using namespace std;
long long ___;
template <typename tn>
inline tn next(void);
template <typename tn>
inline ostream& operator<<(ostream& os, const vector<tn>& v);
string str[200];
vector<pair<long long, long long> > v;
vector<long long> pa;
signed main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  string ans, mid;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> str[i];
  for (long long i = 0; i < n; i++)
    for (long long j = i + 1; j < n; j++) {
      string tmp = str[j];
      reverse(tmp.begin(), tmp.end());
      if (str[i] == tmp) v.push_back(pair<long long, long long>(i, j));
    }
  for (long long i = 0; i < n; i++) {
    string tmp = str[i];
    reverse(tmp.begin(), tmp.end());
    if (str[i] == tmp) {
      mid = str[i];
      continue;
    }
  }
  if (v.size()) {
    for (long long i = 0; i < v.size(); i++) ans += str[v[i].first];
    ans += mid;
    for (long long i = v.size() - 1; i >= 0; i--) ans += str[v[i].second];
  } else if (mid.length())
    ans += mid;
  if (ans.length())
    cout << ans.size() << endl << ans << endl;
  else
    cout << 0 << endl;
  return ~~(0 - 0);
}
template <typename tn>
inline tn next(void) {
  tn k;
  cin >> k;
  return k;
}
template <typename tn>
inline ostream& operator<<(ostream& os, const vector<tn>& v) {
  for (long long i = 0; i < v.size(); i++) os << v[i] << ' ';
  return os;
}
