#include <bits/stdc++.h>
using namespace std;
int to_int(string s) {
  stringstream ss;
  ss << s;
  int a;
  ss >> a;
  return a;
}
string to_str(double a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
bool ishuiwen(string s) {
  int l = s.length();
  if (l == 0)
    return true;
  else {
    for (int i = 0, j = l - 1; i < l && j >= 0; i++, j--) {
      if (s[i] != s[j]) return false;
    }
    return true;
  }
}
int main() {
  cin.tie(0);
  cout << setiosflags(ios::fixed) << setprecision(0);
  int n, m;
  while (cin >> n >> m) {
    set<string> res;
    stringstream ans1;
    stringstream ans2;
    int len = 0;
    bool hasone = false;
    string one;
    string inp;
    for (int i = 0; i < n; i++) {
      cin >> inp;
      if (!hasone && ishuiwen(inp)) {
        one = inp;
      }
      string tmp = inp;
      reverse(inp.begin(), inp.end());
      if (res.find(inp) != res.end()) {
        ans1 << inp;
        len += 2 * m;
        res.erase(inp);
      } else {
        res.insert(tmp);
      }
    }
    if (len == 0) {
      cout << one.length() << endl;
      cout << one << endl;
    } else {
      cout << len + one.length() << endl;
      string s = ans1.str();
      reverse(s.begin(), s.end());
      cout << ans1.str() << one << s << endl;
    }
  }
  return 0;
}
