#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  set<string> dict;
  vector<string> s;
  for (int i = 0; i < n; i++) {
    string s1;
    cin >> s1;
    dict.insert(s1);
    s.push_back(s1);
  }
  vector<string> left, right;
  string mid;
  for (int i = 0; i < n; i++) {
    string temp = s[i];
    reverse(temp.begin(), temp.end());
    if (temp == s[i])
      mid = s[i];
    else if (dict.find(temp) != dict.end()) {
      left.push_back(s[i]);
      right.push_back(temp);
      dict.erase(temp);
      dict.erase(s[i]);
    }
  }
  cout << left.size() * m * 2 + mid.size() << endl;
  for (int i = 0; i < left.size(); i++) cout << left[i];
  cout << mid;
  reverse(right.begin(), right.end());
  for (int i = 0; i < right.size(); i++) cout << right[i];
  return 0;
}
