#include <bits/stdc++.h>
using namespace std;
int n, m;
int dd[105];
vector<string> v, ans;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    string si;
    cin >> si;
    v.push_back(si);
  }
  string res = "";
  int id = -1;
  for (int i = 0; i <= (int)v.size() - 1; ++i) {
    while (dd[i]) ++i;
    if (i > (int)v.size() - 1) break;
    string s = v[i];
    for (int j = i + 1; j <= (int)v.size() - 1; ++j) {
      string s2 = v[j];
      reverse(s2.begin(), s2.end());
      if (s == s2 && !dd[j]) {
        reverse(s2.begin(), s2.end());
        dd[i] = 1;
        dd[j] = 1;
        ans.push_back(s);
        break;
      }
    }
  }
  for (int i = 0; i <= (int)v.size() - 1; ++i) {
    while (dd[i]) ++i;
    if (i > (int)v.size() - 1) break;
    string s = v[i];
    string s2 = s;
    reverse(s.begin(), s.end());
    if (s == s2) {
      if (s.size() > res.size()) {
        res = s;
        id = i;
      }
    }
  }
  for (int i = 0; i <= (int)ans.size() - 1; ++i) {
    res += ans[i];
    reverse(ans[i].begin(), ans[i].end());
    res = ans[i] + res;
  }
  cout << res.size() << "\n";
  cout << res;
  return 0;
}
