#include <bits/stdc++.h>
using namespace std;
set<string> st;
int main() {
  int n, m;
  cin >> n >> m;
  string s, temp, mid = "", fir = "", last = "";
  while (n--) {
    cin >> s;
    temp = s;
    reverse(temp.begin(), temp.end());
    if (temp == s)
      mid = temp;
    else if (st.count(temp)) {
      fir += s;
      last = temp + last;
    }
    st.insert(s);
  }
  string ans = fir + mid + last;
  cout << ans.size() << endl << ans << endl;
  return 0;
}
