#include <bits/stdc++.h>
using namespace std;
int n, m;
const int N = 200;
char a[N][N];
map<string, int> mp;
string s[N];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    mp[s[i]]++;
  }
  string ans1;
  string ans2;
  string ss = "";
  for (int i = 1; i <= n; i++) {
    string c = s[i];
    reverse(c.begin(), c.end());
    if (c == s[i]) {
      if (mp[c] % 2 == 1) {
        for (int i = 1; i <= mp[c] / 2; i++) {
          ans1 += c;
          ans2 = c + ans2;
        }
        ss = c;
        mp[c] = 0;
      } else {
        for (int i = 1; i <= mp[c] / 2; i++) {
          ans1 += c;
          ans2 = c + ans2;
        }
        mp[c] = 0;
      }
    }
    while (mp[c] != 0 && mp[s[i]] != 0) {
      ans1 += s[i];
      ans2 = c + ans2;
      mp[c]--;
      mp[s[i]]--;
    }
  }
  string res = ans1 + ss + ans2;
  cout << res.size() << endl;
  cout << res << endl;
  return 0;
}
