#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
int n, m;
bool use[N];
string ar[N];
string rev(string x) {
  for (int i = 0; i < m / 2; i++) {
    int j = m - i - 1;
    swap(x[i], x[j]);
  }
  return x;
}
bool palindrom(string x) { return (rev(x) == x); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  if ((n == 1) && palindrom(ar[1])) {
    cout << m << '\n' << ar[1] << '\n';
    return 0;
  }
  memset(use, false, sizeof(use));
  int cnt = 0;
  bool good = false;
  vector<string> ans;
  string pal;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      string s = rev(ar[j]);
      if (ar[i] == s) {
        ans.push_back(ar[i]);
        use[i] = use[j] = true;
        cnt += 2;
      }
      if ((!use[i]) && (!good)) {
        if (palindrom(ar[i])) {
          pal = ar[i];
          cnt++;
          good = true;
        }
      }
      if ((!use[j]) && (!good)) {
        if (palindrom(ar[j])) {
          pal = ar[j];
          cnt++;
          good = true;
        }
      }
    }
  }
  cout << cnt * m << '\n';
  int sz = ans.size();
  for (int i = 0; i < sz; i++) {
    cout << ans[i];
  }
  if (good) cout << pal;
  for (int i = sz - 1; i >= 0; i--) {
    cout << rev(ans[i]);
  }
  cout << '\n';
  return 0;
}
