#include <bits/stdc++.h>
using namespace std;
const int NN = 1010;
const int inf = 0x3f3f3f3f;
char s[NN][NN];
char t[NN];
int vst[NN];
vector<int> vec;
int main() {
  int n, m, tmp = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) {
    if (vst[i]) continue;
    vst[i] = 1;
    strcpy(t, s[i]);
    reverse(t, t + m);
    for (int j = 1; j <= n; j++) {
      if (vst[j]) continue;
      if (strstr(t, s[j])) {
        vst[j] = 1;
        vst[i] = 2;
        vec.push_back(i);
        break;
      }
    }
    if (vst[i] == 1 && strcmp(t, s[i]) == 0) {
      tmp = i;
    }
  }
  int sz = 2 * m * (vec.size());
  if (tmp) sz += m;
  cout << sz << endl;
  for (int i : vec) {
    cout << s[i];
  }
  if (tmp) cout << s[tmp];
  for (int i = vec.size() - 1; i >= 0; i--) {
    int j = vec[i];
    strcpy(t, s[j]);
    reverse(t, t + m);
    cout << t;
  }
  return 0;
}
