#include <bits/stdc++.h>
using namespace std;
bool is_palindrome(string s) {
  string t = "";
  t = s;
  reverse((t).begin(), (t).end());
  if (t == s)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  string s = "", t = "";
  vector<string> v(n);
  set<int> ind;
  map<string, int> mp;
  ind.clear();
  long long int len = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mp[v[i]]++;
    s = v[i];
    if (is_palindrome(s)) {
      ind.insert(i);
      len = v[i].length();
    }
  }
  for (int i = 0; i < n; i++) {
    if (mp[v[i]] == 0 || ind.find(i) != ind.end()) continue;
    s = v[i];
    reverse((s).begin(), (s).end());
    for (int j = 0; j < n; j++) {
      if (s == v[j] && mp[v[j]] != 0) {
        len += (2 * (int)s.length());
        t += v[i];
        mp[v[i]]--;
        mp[v[j]]--;
        break;
      }
    }
  }
  if (len == 0)
    printf("0\n");
  else {
    cout << len << "\n";
    cout << t;
    if (!ind.empty()) {
      for (auto x : ind) {
        cout << v[x];
        break;
      }
    }
    reverse((t).begin(), (t).end());
    cout << t;
  }
  return 0;
}
