#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  vector<string> a, b;
  string self = "";
  for (int i = 0; i < n; i++) {
    string temp = s[i];
    reverse(temp.begin(), temp.end());
    if (temp == s[i]) self = s[i];
    for (int j = i + 1; j < n; j++) {
      string temp = s[j];
      reverse(temp.begin(), temp.end());
      if (s[i] == temp) {
        a.push_back(s[i]);
        b.push_back(s[j]);
        break;
      }
    }
  }
  string ans = "";
  for (int i = 0; i < a.size(); i++) {
    ans += a[i];
  }
  if (self.size()) ans += self;
  for (int i = 0; i < b.size(); i++) ans += b[b.size() - 1 - i];
  cout << ans.size() << "\n";
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
