#include <bits/stdc++.h>
using namespace std;
void faltu() {}
const long long N = 0;
void solve() {
  long long n, k;
  cin >> n >> k;
  map<string, long long> make_pair;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    make_pair[s]++;
  }
  long long ans(0);
  string ab = "", e = "";
  vector<string> ba;
  for (auto &r : make_pair) {
    if (r.second) {
      string cur = r.first;
      string cur_new = r.first;
      long long a = r.second;
      reverse(cur.begin(), cur.end());
      auto f = make_pair.find(cur);
      if (f != make_pair.end()) {
        long long b = f->second;
        if (cur != cur_new) {
          ab += cur;
          ba.push_back(cur_new);
          ans += 2;
        } else {
          if (e == "") {
            e = cur;
            ans += 1;
          }
        }
        make_pair[cur] = 0;
        make_pair[cur_new] = 0;
      }
    }
  }
  cout << ans * k << "\n";
  reverse(ba.begin(), ba.end());
  cout << ab << e;
  for (auto r : ba) cout << r;
  cout << "\n";
}
int main() {
  faltu();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
