#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100005;
int main() {
  int n, m;
  char s[105][55], s1[105][55];
  scanf("%d%d", &n, &m);
  for (int cnt, i = 0; i <= n; i++) {
    scanf("%s", s[i]);
    cnt = 0;
    for (int j = m - 1; j >= 0; j--, cnt++) {
      s1[i][cnt] = s[i][j];
    }
    s1[i][cnt] = '\0';
  }
  queue<string> q;
  stack<string> p;
  int vis[105] = {0};
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (strcmp(s[i], s1[j]) == 0) {
        q.push(s[i]);
        p.push(s[j]);
        vis[i] = 1;
        vis[j] = 1;
      }
    }
  }
  queue<string> self;
  for (int i = 0; i < n; i++) {
    if (!vis[i] && strcmp(s[i], s1[i]) == 0) {
      self.push(s[i]);
      break;
    }
  }
  int ans = q.size() * 2 * m + self.size() * m;
  printf("%d\n", ans);
  while (!q.empty()) {
    cout << q.front();
    q.pop();
  }
  while (!self.empty()) {
    cout << self.front();
    self.pop();
  }
  while (!p.empty()) {
    cout << p.top();
    p.pop();
  }
}
