#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int INFL = 0x3f3f3f3f3f3f3f3fLL;
int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int mul(long long int a, long long int b, long long int M) {
  if (b == 0) return 0;
  long long int t = mul(a, b / 2, M);
  if (b & 1) return (t + t + a) % M;
  return (t + t) % M;
}
long long int fpow(long long int a, long long int b, long long int M) {
  if (b == 0) return 1;
  long long int t = fpow(a, b / 2, M);
  if (b & 1) return mul(mul(t, t, M), a, M) % M;
  return mul(t, t, M) % M;
}
long long int divmod(long long int i, long long int j, long long int mod) {
  i %= mod, j %= mod;
  return i * fpow(j, mod - 2, mod) % mod;
}
void ok() { cout << "YES\n"; }
void neok() { cout << "NO\n"; }
bool pal(string second) {
  string t = second;
  reverse(t.begin(), t.end());
  return t == second;
}
bool is_pair(string a, string b) {
  string t = a;
  reverse(t.begin(), t.end());
  return t == b;
}
string mas[110];
bool is_pal[110];
bool used[110] = {};
int total = 0;
string be = "";
string en = "";
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> mas[i];
    if (pal(mas[i])) is_pal[i] = 1;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (!used[j] && is_pair(mas[i], mas[j])) {
        be += mas[i];
        en = mas[j] + en;
        used[i] = 1;
        used[j] = 1;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (!used[i] && pal(mas[i])) {
      be += mas[i];
      break;
    }
  }
  be += en;
  cout << be.size() << "\n";
  cout << be;
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
