#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  int n, m, y = 1;
  cin >> n >> m;
  map<string, int> mp, mt;
  string s, t, l;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
    mt[s]++;
  }
  int sum = 0;
  string t1 = "", t2 = "", t3 = "";
  for (auto x : mp) {
    s = x.first;
    t = s;
    reverse(s.begin(), s.end());
    if (t != s && mt[s] == 1) {
      t1 = t1 + s;
      t3 = t + t3;
      mt[s] = 0;
      mt[t] = 0;
    } else if (t == s && mt[s] == 1) {
      t2 = s;
    }
  }
  s = t1 + t2 + t3;
  cout << s.size() << endl;
  cout << s << endl;
}
