#include <bits/stdc++.h>
using namespace std;
int n, m;
string s[150];
map<string, int> mp;
string s2[150];
int len, temp;
string ans;
int main(void) {
  len = 0;
  temp = 1;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
    mp[s[i]]++;
  }
  string temp = "-1";
  for (int i = 1; i <= n; ++i) {
    string t = s[i];
    reverse(t.begin(), t.end());
    if (mp[t]) {
      if (t == s[i])
        temp = t;
      else
        ans += s[i], --mp[t], --mp[s[i]];
    }
  }
  if (temp != "-1") {
    cout << ans.length() * 2 + temp.length() << endl;
    cout << ans << temp;
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
  } else {
    cout << ans.length() * 2 << endl;
    cout << ans;
    reverse(ans.begin(), ans.end());
    cout << ans;
  }
  return 0;
}
