#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const long long mod = 1e9 + 7;
string ds = "URDL";
int nextx[5] = {-1, 0, 1, 0};
int nexty[5] = {0, 1, 0, -1};
void acc_ios() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
int vis[110];
string s[110];
struct node {
  int x, y;
};
node a[119];
int b[110];
int main() {
  acc_ios();
  int n, m;
  cin >> n >> m;
  int tot = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      reverse(s[j].begin(), s[j].end());
      if (s[j] == s[i]) {
        vis[i] = 1;
        vis[j] = 1;
        a[tot++] = (node){i, j};
        reverse(s[j].begin(), s[j].end());
        break;
      }
      reverse(s[j].begin(), s[j].end());
    }
  }
  for (int i = 0; i < n; i++) {
    int flag = 1;
    for (int j = 0; j < m; j++) {
      if (s[i][j] != s[i][m - 1 - j]) {
        flag = 0;
        break;
      }
    }
    if (flag) vis[i] = 1, b[cnt++] = i;
    if (flag) break;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans += vis[i] * m;
  cout << ans << endl;
  for (int i = 0; i < tot; i++) cout << s[a[i].x];
  for (int i = 0; i < cnt; i++) cout << s[b[i]];
  for (int i = tot - 1; i >= 0; i--) cout << s[a[i].y];
  cout << endl;
  return 0;
}
