#include <bits/stdc++.h>
using namespace std;
inline long long fpow(long long n, long long k, int p = 998244353) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
inline long long inv(long long a, long long p = 998244353) {
  return fpow(a, p - 2, p);
}
inline long long addmod(long long a, long long val, long long p = 998244353) {
  {
    if ((a = (a + val)) >= p) a -= p;
  }
  return a;
}
inline long long submod(long long a, long long val, long long p = 998244353) {
  {
    if ((a = (a - val)) < 0) a += p;
  }
  return a;
}
inline long long mult(long long a, long long b, long long p = 998244353) {
  return (long long)a * b % p;
}
bool isPalindrome(string &str) {
  int l = 0;
  int h = str.size() - 1;
  while (h > l) {
    if (str[l++] != str[h--]) {
      return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vector<pair<long long, long long> > ans;
  long long idx = -1;
  vector<bool> visited(n, false);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j || visited[i] || visited[j]) continue;
      bool check = true;
      for (int k = 0; k < m; k++) {
        if (v[i][k] != v[j][m - 1 - k]) {
          check = false;
          break;
        }
      }
      if (check) {
        visited[i] = true;
        visited[j] = true;
        ans.push_back({i, j});
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!visited[i]) {
      if (isPalindrome(v[i])) {
        idx = i;
        break;
      }
    }
  }
  if (idx == -1 && ans.size() == 0) {
    cout << 0 << "\n"
         << "\n";
  } else {
    if (idx == -1) {
      cout << 2 * ans.size() * m << "\n";
    } else {
      cout << 2 * ans.size() * m + m << "\n";
    }
    for (int i = 0; i < ans.size(); i++) {
      cout << v[ans[i].first];
    }
    if (idx != -1) cout << v[idx];
    for (int i = ans.size() - 1; i >= 0; i--) {
      cout << v[ans[i].second];
    }
    cout << "\n";
  }
}
