#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <class T>
bool uin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  string ans, str;
  map<string, int> check;
  vector<string> cc;
  for (int i = 0; i < n; i++) {
    cin >> str;
    string temp(str.rbegin(), str.rend());
    if (str == temp) {
      ans = temp;
    } else {
      check[str]++;
      cc.emplace_back(str);
    }
  }
  for (int i = 0; i < (int)cc.size(); i++) {
    string temp(cc[i].rbegin(), cc[i].rend());
    if (check[cc[i]] && check[temp]) {
      ans = cc[i] + ans;
      ans += temp;
      check[cc[i]]--;
      check[temp]--;
    }
  }
  cout << ans.size() << '\n';
  cout << ans << '\n';
  return 0;
}
