#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1e5 + 7;
const long long int mod = 1e9 + 7;
bool ispalin(string s) {
  string r = s;
  reverse(r.begin(), r.end());
  return (s == r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  string s, p = "", ans = "";
  vector<string> v;
  unordered_map<string, long long int> vis;
  for (long long int i = 0; i < n; ++i) {
    cin >> s;
    if (ispalin(s)) {
      p = s;
    } else
      v.emplace_back(s);
  }
  sort(v.begin(), v.end());
  for (auto &x : v) {
    s = x;
    reverse(s.begin(), s.end());
    if (binary_search(v.begin(), v.end(), s) and vis.find(s) == vis.end()) {
      ans += x;
      vis[x] = 1;
      vis[s] = 1;
    }
  }
  cout << 2 * ans.length() + p.length() << "\n";
  cout << ans;
  cout << p;
  for (int i = ans.size() - 1; i >= 0; --i) cout << ans.at(i);
  cout << "\n";
  return 0;
}
