#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, m;
string s[maxn], ans[maxn], an;
int f[maxn];
int main() {
  int cen = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
    for (int j = 1; j < i; j++) {
      if (f[j]) continue;
      bool ff = 0;
      for (int k = 0; k < m; ++k) {
        if (s[i][k] != s[j][m - k - 1]) {
          ff = 1;
          break;
        }
      }
      if (ff == 0) {
        an += s[j];
        f[j] = 1;
      }
    }
  }
  int ma = 0;
  for (int i = 1; i <= n; ++i) {
    if (f[i]) continue;
    bool ff = 0;
    for (int j = 0; j < m / 2; ++j) {
      if (s[i][j] != s[i][m - j - 1]) {
        ff = 1;
        break;
      }
    }
    if (ff == 0) {
      if (s[i].size() > ma) {
        ma = s[i].size();
        cen = i;
      }
    }
  }
  int len = 2 * an.size() + s[cen].size();
  cout << len << endl;
  if (len == 0) return 0;
  cout << an;
  if (cen) cout << s[cen];
  reverse(an.begin(), an.end());
  cout << an << endl;
  return 0;
}
