#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  string s[n], temp[n];
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    temp[i] = s[i];
    reverse(temp[i].begin(), temp[i].end());
  }
  long long count = 0;
  string pre[n], post[n];
  for (long long i = 0; i < n; i++) {
    post[i] = "";
    pre[i] = "";
  }
  long long asdf = 0;
  string mid = "";
  long long pre1 = 0, post1 = n - 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = i; j < n; j++) {
      if (temp[i] == s[i] && asdf != 1) {
        mid = s[i];
        s[i] = '0';
        count++;
        asdf = 1;
      } else if (temp[i] == s[j] && i != j) {
        count += 2;
        pre[pre1++] = s[i];
        post[post1--] = temp[i];
        s[i] = '0';
        s[j] = '0';
      }
    }
  }
  cout << count * m << endl;
  for (long long i = 0; i < n; i++) {
    cout << pre[i];
  }
  if (mid != "") cout << mid;
  for (long long i = 0; i < n; i++) {
    cout << post[i];
  }
}
