#include <bits/stdc++.h>
using namespace std;
bool f(int, int);
bool go(int, int, int);
int N, M;
char A[101][51];
bool check[101];
string s, t;
int main(void) {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", A[i]);
  for (int i = 1; i < N; i++) {
    if (!check[i]) {
      for (int j = i + 1; j <= N; j++) {
        if (f(i, j)) {
          check[i] = check[j] = true;
          s += A[i];
          break;
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    if (!check[i] && go(i, 0, M - 1)) {
      t += A[i];
      break;
    }
  }
  printf("%d\n", s.size() * 2 + t.size());
  printf("%s", s.c_str());
  printf("%s", t.c_str());
  reverse(s.begin(), s.end());
  printf("%s\n", s.c_str());
  return 0;
}
bool f(int l, int r) {
  for (int i = 0; i < M; i++)
    if (A[l][i] != A[r][M - 1 - i]) return false;
  return true;
}
bool go(int i, int l, int r) {
  if (l >= r) return true;
  if (A[i][l] == A[i][r])
    return go(i, l + 1, r - 1);
  else
    return false;
}
