#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1, ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return x * f;
}
vector<int> v1, v2;
int n, m;
char s[200][200], t[200][200];
bool check(int x, int y) {
  for (int i = 0; i < m; i++)
    if (t[x][i] != s[y][i]) return false;
  return true;
}
bool vis[200];
signed main() {
  n = read(), m = read();
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) t[i][j] = s[i][m - j - 1];
  }
  for (int i = 0; i < n; i++)
    if (!vis[i])
      for (int j = i + 1; j < n; j++)
        if (!vis[j]) {
          if (check(i, j)) {
            v1.push_back(i), v2.push_back(j);
            vis[i] = vis[j] = true;
            break;
          }
        }
  for (int i = 0; i < n; i++)
    if (check(i, i)) {
      v1.push_back(i);
      break;
    }
  printf("%d\n", (v1.size() + v2.size()) * m);
  for (int i = 0; i < v1.size(); i++)
    for (int j = 0; j < m; j++) putchar(s[v1[i]][j]);
  for (int i = v2.size() - 1; i >= 0; i--)
    for (int j = 0; j < m; j++) putchar(s[v2[i]][j]);
  return 0;
}
