#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string s, long long m) {
  for (long long i = 0; i < m; i++) {
    if (s[i] != s[m - 1 - i]) return false;
  }
  return true;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<string> v;
  string mid = "";
  map<string, long long> p;
  string ans = "";
  for (long long i = 0; i < n; i++) {
    string s, rev;
    cin >> s;
    rev = s;
    reverse((rev).begin(), (rev).end());
    if (p.find(rev) != p.end() && p[rev]) {
      p[rev] -= 1;
      v.push_back(s);
    } else {
      if (p.find(s) != p.end())
        p[s] += 1;
      else
        p[s] = 1;
    }
  }
  long long prev = 0;
  for (auto first : p) {
    if (isPalindrome(first.first, m) && first.second > prev) {
      mid = "";
      for (long long i = 0; i < first.second; i++) {
        mid += first.first;
      }
      prev = first.second;
    }
  }
  for (auto s : v) {
    ans += s;
  }
  string temp = ans;
  reverse((temp).begin(), (temp).end());
  ans += mid;
  ans += temp;
  cout << ans.size() << '\n' << ans;
  return;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
