#include <bits/stdc++.h>
using namespace std;
int n, m;
string str[110];
int rev[110];
bool counted[110];
stack<int> st;
queue<int> q;
int length;
bool isRev(string s, string t) {
  for (int i = 0; i < m; i++)
    if (s[i] != t[m - i - 1]) return false;
  return true;
}
bool same(string s) {
  char c = s[0];
  for (int i = 1; i < m; i++)
    if (c != s[i]) return false;
  return true;
}
bool loneRev(string s) {
  int i = 0, j = m - 1;
  while (i <= j) {
    if (s[i] != s[j]) return false;
    i++;
    j--;
  }
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> str[i];
  for (int i = 1; i <= n; i++) {
    if (!rev[i]) {
      for (int j = i + 1; j <= n; j++) {
        if (isRev(str[i], str[j])) {
          rev[i] = j;
          rev[j] = i;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (rev[i] && !counted[i]) {
      counted[i] = true;
      counted[rev[i]] = true;
      q.push(i);
      st.push(rev[i]);
      length += (2 * m);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!counted[i]) {
      if (same(str[i]) || loneRev(str[i])) {
        length += m;
        q.push(i);
        break;
      }
    }
  }
  while (st.size()) {
    int x = st.top();
    st.pop();
    q.push(x);
  }
  cout << length << endl;
  while (q.size()) {
    int x = q.front();
    q.pop();
    cout << str[x];
  }
}
