#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
string ar[1005];
int N, M;
void solve() {
  cin >> N >> M;
  map<string, int> vis;
  for (int i = 0; i < N; i++) {
    cin >> ar[i];
    vis[ar[i]]++;
  }
  string forward = "";
  string backward = "";
  for (int i = 0; i < N; i++) {
    string tmp = "";
    for (int j = ar[i].size() - 1; j >= 0; j--) {
      tmp += ar[i][j];
    }
    if (tmp.compare(ar[i]) == 0) {
      while (vis[tmp] >= 2) {
        vis[tmp] -= 2;
        forward += tmp;
        backward += tmp;
      }
      continue;
    }
    while (vis[tmp] > 0 && vis[ar[i]] > 0) {
      vis[tmp]--;
      vis[ar[i]]--;
      forward += tmp;
      backward += tmp;
    }
  }
  for (int i = 0; i < N; i++) {
    if (vis[ar[i]]) {
      bool flag = true;
      for (int j = 0; j < ar[i].size(); j++) {
        if (ar[i][j] != ar[i][ar[i].size() - 1 - j]) {
          flag = false;
          break;
        }
      }
      if (flag) {
        forward += ar[i];
        break;
      }
    }
  }
  cout << (forward.size() + backward.size()) << endl;
  reverse(backward.begin(), backward.end());
  cout << forward << backward << endl;
  return;
}
int main() {
  int T;
  T = 1;
  for (int i = 0; i < T; i++) solve();
  return (0);
}
