#include <bits/stdc++.h>
using namespace std;
bool chk(string s) {
  int l = s.size();
  for (int i = 0, j = l - 1; i < j; i++, j--) {
    if (s[i] != s[j]) return 0;
  }
  return 1;
}
int main() {
  int n, m;
  cin >> n >> m;
  string s[n + 5];
  int vis[n + 5];
  map<string, string> pal;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (chk(s[i])) vis[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (vis[i] != 0) continue;
    for (int j = i + 1; j < n; j++) {
      if (vis[j] != 0) continue;
      string ch = s[i] + s[j];
      if (chk(ch)) {
        vis[i] = 2;
        pal[s[i]] = s[j];
        break;
      }
    }
  }
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (vis[i] == 2) ans += s[i];
  }
  map<string, int> mp;
  int mx = 0;
  string tmp;
  for (int i = 0; i < n; i++) {
    if (vis[i] == 1) {
      mp[s[i]]++;
      if (mx < mp[s[i]]) tmp = s[i], mx = mp[s[i]];
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == tmp) ans += tmp;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (vis[i] == 2) ans += pal[s[i]];
  }
  cout << ans.size() << endl << ans << endl;
  return 0;
}
