#include <bits/stdc++.h>
using namespace std;
bool isPalind(string s) {
  string cpy = s;
  reverse((s).begin(), (s).end());
  if (cpy == s) return true;
  return false;
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<string> v(n);
  unordered_map<string, int> mp;
  for (int i = 0; i < (int)n; i++) {
    cin >> v[i];
    mp[v[i]]++;
  }
  deque<string> dq;
  set<string> st;
  bool onePal = false;
  string onePalS = "";
  for (string i : v) {
    string rs = "";
    for (int j = m - 1; j >= 0; j--) rs += i[j];
    bool fnd1 = st.find(rs) == st.end();
    bool fnd2 = st.find(i) == st.end();
    if (mp.find(rs) != mp.end() && fnd1 && fnd2 && i != rs) {
      dq.push_front(i);
      dq.push_back(rs);
      st.insert(i);
      st.insert(rs);
    } else {
      if (isPalind(i) && !onePal) {
        onePal = true;
        onePalS += i;
      }
    }
  }
  int siz = dq.size(), cnt = 0;
  string finString = "";
  for (auto i : dq) {
    finString += i;
    cnt++;
    if (cnt == siz / 2) {
      finString += onePalS;
    }
  }
  if (dq.size() == 0) {
    cout << onePalS.length() << "\n" << onePalS << "\n";
    return;
  }
  cout << finString.length() << "\n";
  cout << finString << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  auto start = std::chrono::high_resolution_clock::now();
  int t = 1;
  while (t--) solve();
  auto stop = std::chrono::high_resolution_clock::now();
  auto duration =
      std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
  cerr << "\nTime taken : "
       << ((long double)duration.count()) / ((long double)1e9) << " s " << endl;
  return 0;
}
