#include <bits/stdc++.h>
using namespace std;
string s[105], g;
map<string, int> ma;
int pan = 1;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    ma[s[i]] = 1;
  }
  for (int i = 0; i < n; i++) {
    string t = s[i];
    reverse(t.begin(), t.end());
    if (ma[t] == 1) {
      if (t == s[i] && pan) {
        g.insert(g.length() / 2, t);
        pan = 0;
      } else if (t != s[i]) {
        g.append(t);
        g.insert(0, s[i]);
        ma[s[i]] = 0;
      }
    }
  }
  printf("%d\n", g.length());
  cout << g << endl;
  return 0;
}
