#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, aux[101] = {};
  cin >> n >> m;
  char A[51], B[501][501] = {};
  int k = 0;
  for (int i = 0; i < n; i++) {
    cin >> A;
    int ok = 1;
    for (int j = 0; j * 2 < m; j++) {
      if (A[j] != A[m - j - 1]) ok = 0;
    }
    if (ok == 1) aux[i] = 1;
    strcpy(B[i], A);
  }
  int E[5001] = {}, F[5001] = {}, G[5001] = {}, nr = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int ok1 = 1;
      for (int k = 0; k < m; k++) {
        int q = m - k - 1;
        if (B[i][k] != B[j][q]) ok1 = 0;
      }
      if (ok1 == 1) {
        nr++;
        E[nr] = i;
        F[nr] = j;
        G[i] = 1;
        G[j] = 1;
      }
    }
  char cuv[5001] = {};
  for (int i = 0; i < n; i++)
    if (aux[i] == 1 and G[i] == 0) {
      strcpy(cuv, B[i]);
      break;
    }
  for (int i = 1; i <= nr; i++) {
    char AUX[5001] = {};
    strcat(cuv, B[F[i]]);
    strcpy(AUX, cuv);
    cuv[0] = NULL;
    strcat(cuv, B[E[i]]);
    strcat(cuv, AUX);
  }
  cout << strlen(cuv) << '\n' << cuv;
  return 0;
}
