#include <bits/stdc++.h>
using namespace std;
string ss2 = "";
string ss1 = "";
string ss = "";
void check(vector<string> v, long long n, long long m, long long i) {
  string s(v[i]);
  reverse(v[i].begin(), v[i].end());
  if (s == v[i]) {
    ss = s;
    return;
  }
  for (long long j = i + 1; j < n; j++) {
    if (v[j] == v[i]) {
      ss1 += v[j];
      reverse(v[j].begin(), v[j].end());
      ss2 = v[j] + ss2;
      return;
    }
  }
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<string> v;
  string s;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  for (long long i = 0; i < n; i++) {
    check(v, n, m, i);
  }
  string sk = "";
  sk += ss2 + ss + ss1;
  cout << sk.size() << endl;
  cout << sk << endl;
  return 0;
}
