#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[105];
string s[105];
string ans = "";
bool check(const string &a, const string &b) {
  if (a.size() != b.size()) {
    return false;
  }
  int sz = a.size();
  for (int i = 0; i < sz; i++) {
    if (a[i] != b[sz - i - 1]) {
      return false;
    }
  }
  return true;
}
string rev(const string &s) {
  string ans = "";
  for (int i = s.size() - 1; i >= 0; i--) {
    ans += s[i];
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (!vis[i] && !vis[j] && check(s[i], s[j])) {
        vis[i] = vis[j] = true;
        ans += s[i];
      }
    }
  }
  int mx = 0;
  string md = "";
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && check(s[i], s[i])) {
      if (s[i].size() > mx) {
        mx = s[i].size();
        md = s[i];
      }
    }
  }
  cout << ans.size() * 2 + md.size() << endl;
  cout << ans + md + rev(ans) << endl;
}
