#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long i, j, k, arr[100050], l, m, n, x, y, coun, sum, ans, T, check;
  vector<string> v, pal, pale, si;
  string s;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  map<string, long long> mp;
  for (i = 0; i < n; i++) {
    s = v[i];
    string z = s;
    reverse(z.begin(), z.end());
    if (mp.find(z) != mp.end()) {
      mp[z]++;
    } else {
      mp[s]++;
    }
  }
  string ss;
  for (auto i : mp) {
    s = i.first;
    l = i.second;
    x = l / 2;
    mp[s] = l % 2;
    while (x--) {
      ss += s;
    }
  }
  string lx;
  for (auto i : mp) {
    s = i.first;
    if (mp[s] <= 0) continue;
    string z = s;
    reverse(z.begin(), z.end());
    if (s == z) {
      if (s.size() > lx.size()) {
        lx = s;
      }
    }
  }
  s = ss;
  reverse(s.begin(), s.end());
  ss += lx;
  ss += s;
  cout << ss.size() << "\n";
  cout << ss << "\n";
  return 0;
}
