#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m, maxim;
  bool vis[1000];
  string str[1000], temp, tempo, tempr;
  vector<string> forw;
  vector<string> backw;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> str[i];
    vis[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      reverse(str[j].begin(), str[j].end());
      temp = str[j];
      reverse(str[j].begin(), str[j].end());
      if (str[i] == temp) {
        forw.push_back(str[i]);
        backw.push_back(str[j]);
        vis[i] = 1;
        vis[j] = 1;
      }
    }
  }
  tempr = "";
  for (int i = 0; i < n; i++) {
    reverse(str[i].begin(), str[i].end());
    tempo = str[i];
    reverse(str[i].begin(), str[i].end());
    maxim = -1;
    if (tempo == str[i]) {
      if (vis[i] == 0) {
        if ((long)str[i].size() > maxim) {
          maxim = str[i].size();
          tempr = str[i];
          vis[i] = 1;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) temp = "";
  for (int i = 0; i < forw.size(); i++) {
    temp += forw[i];
  }
  temp += tempr;
  reverse(backw.begin(), backw.end());
  for (int i = 0; i < backw.size(); i++) {
    temp += backw[i];
  }
  cout << temp.size() << '\n';
  cout << temp;
  return 0;
}
