#include <bits/stdc++.h>
using namespace std;
bool compare(long long int x, long long int y) { return x > y; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    long long int i = 0, j = 0, k = 0, l = 0, z = 0, y = 0;
    long long int n, m = 0;
    cin >> n >> m;
    vector<string> v;
    for (i = 0; i < n; i++) {
      string x;
      cin >> x;
      v.push_back(x);
    }
    sort(v.begin(), v.end());
    string s = "";
    z = 0;
    k = 1;
    vector<string>::iterator it = v.begin();
    while (v.size() > 1 && k == 1) {
      k = 0;
      string y = v[0];
      for (i = 0; i < v.size() - 1 && k == 0; i++) {
        j = i + 1;
        for (j; j < v.size(); j++) {
          y = v[j];
          std::reverse(y.begin(), y.end());
          if (v[i] == y) {
            k = 1;
            s.insert(z, v[i]);
            z = z + m;
            s.insert(z, v[j]);
            it = v.begin() + i;
            v.erase(it);
            it = v.begin() + j - 1;
            v.erase(it);
            break;
          }
        }
      }
    }
    for (i = 0; i < v.size(); i++) {
      string y = v[i];
      std::reverse(y.begin(), y.end());
      if (y == v[i]) {
        s.insert(z, v[i]);
        break;
      }
    }
    cout << s.length() << endl;
    cout << s << endl;
  }
}
