#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 110;
string s[N];
bool use[N] = {0};
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  int num = 0;
  vector<string> ans[2];
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (use[j]) continue;
      bool v = 1;
      for (int k = 0; k < m; k++) {
        if (s[i][k] != s[j][m - k - 1]) {
          v = 0;
          break;
        }
      }
      if (v) {
        num += 2;
        use[i] = use[j] = 1;
        ans[0].push_back(s[i]);
        ans[1].push_back(s[j]);
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!use[i]) {
      int v = 1;
      for (int j = 0; j < m; j++) {
        if (s[i][j] != s[i][m - j - 1]) {
          v = 0;
          break;
        }
      }
      if (v) {
        ans[0].push_back(s[i]);
        num++;
        break;
      }
    }
  }
  cout << num * m << endl;
  for (int i = 0; i < ans[0].size(); i++) cout << ans[0][i];
  for (int i = ans[1].size() - 1; i >= 0; i--) cout << ans[1][i];
  return 0;
}
