#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, i, e, f, g, n, m, k, l, x, y, t, fix[200005];
map<string, long long> mp;
string s[200005], s1, s2;
int main() {
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> s[i];
    s1 = s[i];
    reverse(s1.begin(), s1.end());
    if (mp[s1] > 0) {
      mp[s1]--;
      a++;
      for (long long j = 1; j < n; j++)
        if (s1 == s[j]) {
          fix[j] = a;
          break;
        }
      fix[i] = a;
    } else
      mp[s[i]]++;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  for (long long i = 1; i <= n; i++) {
    if (fix[i] != 0) continue;
    k = 0;
    for (long long j = 0; j < s[i].size() / 2; j++) {
      if (s[i][j] != s[i][s[i].size() - 1 - j]) {
        k = 1;
        break;
      }
    }
    if (k == 0) {
      fix[i] = -1;
      l = 1;
      break;
    }
  }
  cout << 2 * a * m + l * m << endl;
  for (long long i = 1; i <= a; i++) {
    for (long long j = 1; j <= n; j++)
      if (fix[j] == i) {
        cout << s[j];
        break;
      }
  }
  for (long long j = 1; j <= n; j++) {
    if (fix[j] == -1) {
      cout << s[j];
      break;
    }
  }
  for (long long i = a; i >= 1; i--) {
    for (long long j = n; j >= 1; j--) {
      if (fix[j] == i) {
        cout << s[j];
        break;
      }
    }
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
  while (true) {
    break;
  }
}
