#include <bits/stdc++.h>
using namespace std;
long long input() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
const int N = 107;
string s[N];
map<string, int> p;
int vis[N];
string res;
int main() {
  int n = input(), m = input();
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    if (p[s[i]])
      res += s[i], vis[i] = vis[p[s[i]]] = 1;
    else
      reverse(s[i].begin(), s[i].end()), p[s[i]] = i;
  }
  string ser = res;
  reverse(ser.begin(), ser.end());
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    int flag = 1;
    for (int j = 0; j < m / 2; j++) {
      if (s[i][j] != s[i][m - j - 1]) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      res += s[i];
      break;
    }
  }
  res += ser;
  cout << res.length() << endl;
  cout << res << endl;
}
