#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i;
  cin >> n >> m;
  string s;
  vector<string> v;
  map<string, long long int> mp;
  vector<pair<long long, long long>> ans;
  for (i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
    mp[s] = i;
    reverse(s.begin(), s.end());
    if (mp.count(s)) {
      ans.push_back({mp[s], i});
    }
  }
  stack<long long> st;
  vector<long long> final;
  for (auto it : ans) {
    if (it.first != it.second) {
      final.push_back(it.first);
      st.push(it.second);
    }
  }
  for (auto it : ans) {
    if (it.first == it.second) {
      final.push_back(it.first);
      break;
    }
  }
  while (!st.empty()) {
    i = st.top();
    final.push_back(i);
    st.pop();
  }
  n = final.size();
  n = m * n;
  cout << n << "\n";
  for (auto it : final) {
    cout << v[it];
  }
  return 0;
}
