#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const long long MOD = 1e9 + 7;
const long long INF = 0x3f3f3f3f;
const long long MAXN = 1e5 + 7;
int n, m, ans, vis[111];
string s[111], t[111];
vector<int> p, q, o;
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    t[i] = s[i];
    reverse(t[i].begin(), t[i].end());
  }
  for (int i = 0; i < n; ++i) {
    if (vis[i]) continue;
    int flag = -1;
    for (int j = i + 1; j < n; ++j) {
      if (vis[j]) continue;
      if (s[i] == t[j]) {
        flag = j;
        break;
      }
    }
    if (flag == -1) {
      if (s[i] == t[i]) o.push_back(i);
      continue;
    }
    p.push_back(i);
    q.push_back(flag);
    vis[i] = vis[flag] = 1;
  }
  string res = "";
  for (auto x : p) res += s[x];
  if (o.size() > 0) res += s[o[0]];
  reverse(q.begin(), q.end());
  for (auto x : q) res += s[x];
  cout << res.size() << endl;
  cout << res << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, Case = 1;
  while (Case--) solve();
  return 0;
}
