#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
string s[maxn];
map<string, int> mp;
string rev(string s) {
  string ans;
  int n = s.size();
  for (int i = n - 1; i >= 0; i--) ans += s[i];
  return ans;
}
int ans[maxn], ind[maxn];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    mp[s[i]] = i;
  }
  int ps = 0, md = 0, tot = 0;
  for (int i = 1; i <= n; i++) {
    string ss = rev(s[i]);
    if (s[i] == ss) {
      if (!md) {
        md = 1;
        ans[i] = -1;
        ind[0] = i;
      }
    } else if (mp[ss] && !ans[mp[ss]]) {
      ans[i] = ++tot;
      ind[tot] = i;
      ps++;
    }
  }
  printf("%d\n", (ps * 2 + md) * m);
  for (int i = 1; i <= ps; i++) {
    int p = ind[i];
    cout << s[p];
  }
  cout << s[ind[0]];
  for (int i = ps; i >= 1; i--) {
    int p = ind[i];
    cout << s[mp[rev(s[p])]];
  }
  return 0;
}
