#include <bits/stdc++.h>
using namespace std;
set<string> st;
int main() {
  int q, n;
  cin >> q >> n;
  string s, t, ans = "", p = "";
  while (q--) {
    cin >> s;
    t = s;
    reverse(t.begin(), t.end());
    if (s == t)
      p = t;
    else if (st.count(t))
      ans += t;
    st.insert(s);
  }
  string r = ans;
  reverse(r.begin(), r.end());
  ans = ans + p + r;
  cout << ans.length() << '\n' << ans;
}
