#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, m, o[N * N], cnt, flag[N], ans[N * N];
char s[N][N];
inline bool ck(const int p, const int q) {
  for (int i = 1; i <= m; ++i)
    if (s[p][i] != s[q][m - i + 1]) return 0;
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  int i, j;
  for (i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  for (i = 1; i <= n; ++i)
    if (!flag[i])
      for (j = i + 1; j <= n; ++j)
        if (!flag[j] && ck(i, j)) {
          o[++cnt] = i, o[++cnt] = j, flag[i] = flag[j] = 1;
          break;
        }
  for (i = 1; i <= n; ++i)
    if (!flag[i] && ck(i, i)) {
      o[++cnt] = i;
      break;
    }
  printf("%d\n", cnt * m);
  int hd = 0, tl = cnt;
  for (i = 1; i <= cnt; i += 2) ans[tl--] = o[i + 1], ans[++hd] = o[i];
  for (i = 1; i <= cnt; ++i) printf("%s", s[ans[i]] + 1);
  return 0;
}
