#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
bool ispalindrome(string s, int m) {
  int c = 0;
  for (int i = 0; i < m / 2; i++) {
    if (s[i] != s[m - i - 1]) {
      c = 1;
      break;
    }
  }
  if (c == 1) {
    return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  string s[n];
  int vis[n];
  memset(vis, 0, sizeof(vis));
  string p;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  vector<string> v, v1;
  for (long long i = 0; i < n; i++) {
    if (vis[i] == 1) {
      continue;
    }
    string k = s[i];
    reverse(k.begin(), k.end());
    for (long long j = i + 1; j < n; j++) {
      if (s[j] == k) {
        vis[i] = 1;
        vis[j] = 1;
        v.push_back(s[i]);
        v.push_back(s[j]);
        break;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (vis[i] == 0) {
      if (ispalindrome(s[i], m)) {
        p = s[i];
        break;
      }
    }
  }
  int n1 = v.size();
  for (int i = 0; i < n1 - 1; i += 2) {
    p += v[i];
    p = v[i + 1] + p;
  }
  cout << p.length() << "\n";
  cout << p << "\n";
}
