#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  set<string> s;
  set<string>::iterator it, it1, it2;
  deque<string> d;
  int i, c = 1;
  string no, no1;
  for (i = 0; i < n; i++) {
    cin >> no;
    s.insert(no);
    no1 = no;
    reverse(no1.begin(), no1.end());
    if (no == no1 and c == 1) {
      d.push_back(no);
      c = 0;
    }
  }
  it = s.begin();
  while (it != s.end()) {
    no = *it;
    reverse(no.begin(), no.end());
    it1 = it;
    it1++;
    while (it1 != s.end()) {
      if (*it1 == no) {
        d.push_front(no);
        d.push_back(*it);
        s.erase(it1);
        break;
      }
      it1++;
    }
    it2 = it;
    it++;
    s.erase(it2);
  }
  cout << d.size() * m << endl;
  while (!d.empty()) {
    cout << d.back();
    d.pop_back();
  }
  return 0;
}
