#include <bits/stdc++.h>
using namespace std;
const int w = 105;
const long long mod = 1e9 + 7;
int vis[w], len, l1;
int n, m;
string s[w];
string s1[w], s2[w], s3[w];
bool cal(int x, int y) {
  string aa = s[x];
  string bb = s[y];
  for (int i = 0, j = m - 1; i < m; ++i, --j)
    if (aa[i] != bb[j]) return 0;
  return 1;
}
bool gao(int x) {
  string aa = s[x];
  for (int i = 0, j = m - 1; i <= j; ++i, --j)
    if (aa[i] != aa[j]) return 0;
  return 1;
}
int main() {
  int i, j;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) cin >> s[i];
  for (i = 1; i <= n; ++i) {
    if (vis[i]) continue;
    for (j = i + 1; j <= n; ++j) {
      if (vis[j]) continue;
      if (cal(i, j)) {
        vis[i] = 1, vis[j] = 1;
        len++;
        s1[len] = s[i];
        s2[len] = s[j];
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (vis[i]) continue;
    if (gao(i)) s3[++l1] = s[i];
  }
  string ans = "";
  for (i = 1; i <= len; ++i) ans += s1[i];
  if (l1) ans += s3[1];
  for (i = len; i; i--) ans += s2[i];
  printf("%d\n", ans.size());
  cout << ans << endl;
}
