#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<string> a;
  vector<string> ra;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    a.push_back(s);
    reverse(s.begin(), s.end());
    ra.push_back(s);
  }
  vector<int> selected;
  vector<int> arr(n, -1);
  vector<int> pallindrome;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (ra[i] == a[j]) {
        arr[i] = j;
        if (arr[j] != i) {
          selected.push_back(i);
        } else if (i == j) {
          pallindrome.push_back(i);
        }
      }
    }
  }
  cout << (selected.size() * 2 * m) + (pallindrome.size() > 0 ? 1 : 0) * m
       << endl;
  for (int i = 0; i < selected.size(); ++i) {
    cout << a[selected[i]];
  }
  if (pallindrome.size() > 0) {
    cout << a[pallindrome[0]];
  }
  for (int i = selected.size() - 1; i >= 0; --i) {
    cout << ra[selected[i]];
  }
  return 0;
}
