#include <bits/stdc++.h>
using namespace std;
vector<string> vs;
string s;
int ans;
vector<string> ans1;
vector<string> ans2;
int nm, ll;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> nm >> ll;
  for (int i = 0; i < nm; i++) {
    string temp;
    cin >> temp;
    vs.push_back(temp);
  }
  for (int i = 0; i < nm; i++) {
    s = vs[i];
    reverse(s.begin(), s.end());
    for (int j = i + 1; j < nm; j++) {
      string tmp = vs[j];
      if (tmp.compare(s) == 0) {
        ans += tmp.length() + s.length();
        ans1.push_back(vs[i]);
        ans2.push_back(s);
        break;
      }
    }
  }
  for (int i = 0; i < nm; i++) {
    s = vs[i];
    reverse(s.begin(), s.end());
    if (s.compare(vs[i]) == 0) {
      ans += s.length();
      ans1.push_back(vs[i]);
      break;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans1.size(); i++) cout << ans1[i];
  for (int i = ans2.size() - 1; i >= 0; i--) cout << ans2[i];
  return 0;
}
