#include <bits/stdc++.h>
using namespace std;
const int N = 101;
int n, m;
string s[N];
bool taken[N];
bool isPal(string s) {
  for (int i = 0; i < ((int)(s).size()) / 2; i++) {
    if (s[i] != s[((int)(s).size()) - 1 - i]) return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  vector<pair<int, int>> v;
  string a = "", b = "";
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++)
      if (isPal(s[i] + s[j])) {
        v.push_back({i, j});
        a += s[i];
        string tmp = s[j];
        reverse((tmp).begin(), (tmp).end());
        b += tmp;
        taken[i] = taken[j] = 1;
      }
  }
  reverse((b).begin(), (b).end());
  string c = "";
  for (int i = 0; i < n; i++)
    if (isPal(s[i]) && !taken[i]) {
      c = s[i];
      break;
    }
  cout << ((int)(a).size()) + ((int)(b).size()) + ((int)(c).size()) << '\n';
  cout << a << c << b << '\n';
  return 0;
}
