#include <bits/stdc++.h>
using namespace std;
int check_pal(string str) {
  for (int i = 0, j = str.size() - 1; i < str.size() / 2; i++, j--)
    if (str[i] != str[j]) return 0;
  return 1;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> v(n), ans1, ans2;
  int used[n];
  memset(used, 0, sizeof(used));
  string pal = "";
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int i = 0; i < n; i++) {
    string tmp1 = v[i];
    reverse(tmp1.begin(), tmp1.end());
    for (int j = i + 1; j < n; j++) {
      if (v[j] == tmp1) {
        ans1.push_back(v[i]);
        ans2.push_back(v[j]);
        used[i] = 1;
        used[j] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (!used[i] && check_pal(v[i]) && v[i].size() > pal.size()) pal = v[i];
  int sum = pal.size();
  for (int i = 0; i < ans1.size(); i++) sum += ans1[i].size() + ans2[i].size();
  cout << sum << endl;
  for (int i = 0; i < ans1.size(); i++) cout << ans1[i];
  cout << pal;
  for (int i = ans2.size() - 1; i >= 0; i--) cout << ans2[i];
  cout << endl;
}
