#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-ffloat-store")
#pragma GCC optimize("-fno-defer-pop")
long long int power(long long int a, long long int b, long long int m) {
  if (b == 0) return 1;
  if (b == 1) return a % m;
  long long int t = power(a, b / 2, m) % m;
  t = (t * t) % m;
  if (b & 1) t = ((t % m) * (a % m)) % m;
  return t;
}
long long int modInverse(long long int a, long long int m) {
  return power(a, m - 2, m);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, l, n, m;
  cin >> n >> m;
  string ar[n + 1];
  map<string, long long int> mp, m2, m3;
  vector<string> v2;
  for (i = 1; i <= n; i++) {
    cin >> ar[i];
    mp[ar[i]] = 1;
  }
  for (i = 1; i <= n; i++) {
    string s = ar[i];
    reverse(s.begin(), s.end());
    if (s == ar[i]) {
      m3[ar[i]]++;
    } else if (mp[s] != 0 && m2[s] == 0) {
      m2[ar[i]] = 1;
      v2.push_back(ar[i]);
    }
  }
  string an;
  for (auto it : v2) {
    an += it;
  }
  string x;
  long long int mx = 0;
  for (auto it : m3) {
    if (it.second > mx) {
      mx = it.second;
      x = it.first;
    }
  }
  for (i = 0; i < mx; i++) {
    an += x;
  }
  reverse(v2.begin(), v2.end());
  for (auto it : v2) {
    string s = it;
    reverse(s.begin(), s.end());
    an += s;
  }
  cout << an.length() << "\n";
  cout << an;
  return 0;
}
