#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  string s[n + 1];
  for (long long int i = 0; i < n; i++) {
    cin >> s[i];
  }
  bool visited[n + 10];
  std::vector<long long int> v1;
  std::vector<long long int> v2;
  for (long long int i = 0; i < n; i++) visited[i] = true;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      string p = s[j];
      reverse(p.begin(), p.end());
      if (s[i] == p && visited[j] && visited[i] && i != j) {
        visited[i] = false;
        visited[j] = false;
        v1.push_back(i);
        v2.push_back(j);
        break;
      }
    }
  }
  long long int x = -1;
  long long int s1;
  long long int flag = 0;
  for (long long int i = 0; i < n; i++) {
    string p = s[i];
    reverse(p.begin(), p.end());
    if (s[i] == p && visited[i]) {
      long long int r = s[i].size();
      if (r >= x) {
        flag = 1;
        s1 = i;
        x = s[i].size();
      }
    }
  }
  string ans;
  if (v1.size() > 0) {
    for (long long int i = 0; i < v1.size(); i++) ans += s[v1[i]];
  }
  if (flag == 1) {
    ans += s[s1];
  }
  if (v1.size() > 0) {
    for (long long int i = v2.size() - 1; i >= 0; i--) ans += s[v2[i]];
  }
  if (ans.size() > 0)
    cout << ans.size() << "\n" << ans;
  else
    cout << "0";
}
