#include <bits/stdc++.h>
using namespace std;
const int mxN = 100;
int n, m;
string a[mxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  set<string> s;
  int ans = 0, flg = 0;
  string l = "", mid = "", r = "";
  for (int i = 0, x; i < n; ++i) cin >> a[i], s.insert(a[i]);
  for (int i = 0; i < n; ++i) {
    string rev = a[i];
    reverse(rev.begin(), rev.end());
    if (rev == a[i])
      mid = rev;
    else if (s.find(rev) != s.end()) {
      l = a[i] + l;
      r += rev;
      ans += 2 * m;
      s.erase(a[i]);
      s.erase(rev);
    }
  }
  cout << ans + (int)mid.size() << "\n";
  cout << l + mid + r << "\n";
}
