#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  auto pd = [&](string& s1, string& s2) -> bool {
    for (int i = 0; i < m; i++) {
      if (s1[i] != s2[m - i - 1]) {
        return false;
      }
    }
    return true;
  };
  deque<string> res;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (res.empty() && pd(a[i], a[i])) {
      res.push_back(a[i]);
    }
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (pd(a[i], a[j])) {
        res.push_front(a[i]);
        res.push_back(a[j]);
      }
    }
  }
  cout << res.size() * m << "\n";
  string s;
  for (const auto& i : res) {
    s += i;
  }
  cout << s << "\n";
  return 0;
}
