#include <bits/stdc++.h>
using namespace std;
long double pi = 3.14159;
long long fpower(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  string str = "";
  set<string> rev, game;
  string k = "";
  for (int i = 0; i < n; i++) {
    string st = s[i];
    if (rev.find(st) != rev.end()) {
      game.insert(st);
    }
    reverse(st.begin(), st.end());
    if (s[i] == st)
      k = st;
    else {
      rev.insert(st);
    }
  }
  long long index = 0;
  for (auto x : game) {
    string rr = x;
    reverse(rr.begin(), rr.end());
    string mr = x + rr;
    str.insert(index, mr);
    index += m;
  }
  str.insert(index, k);
  cout << str.length() << endl;
  cout << str << endl;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
}
