#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 110;
int n, k, l, m;
int a, b, c, d, e;
string s[MAX_N];
int para[MAX_N];
bool checkPalindromes(int a, int b) {
  reverse(s[a].begin(), s[a].end());
  if (s[a] == s[b]) {
    reverse(s[a].begin(), s[a].end());
    return true;
  }
  reverse(s[a].begin(), s[a].end());
  return false;
}
bool checkIfPalindrome(int a) {
  string temp = s[a];
  reverse(temp.begin(), temp.end());
  if (temp == s[a]) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    para[i] = -1;
  }
  for (int i = 0; i < n; ++i) {
    if (para[i] >= 0 || para[i] <= -2) continue;
    for (int j = i + 1; j < n; ++j) {
      if (checkPalindromes(i, j)) {
        para[i] = j;
        para[j] = -2;
        break;
      }
    }
    if (para[i] < 0 && checkIfPalindrome(i)) {
      para[i] = -3;
    }
  }
  string result = "";
  for (int i = 0; i < n; ++i) {
    if (para[i] >= 0) {
      result += s[i];
    }
  }
  string resultRev = result;
  reverse(resultRev.begin(), resultRev.end());
  for (int i = 0; i < n; ++i) {
    if (para[i] == -3) {
      result += s[i];
      break;
    }
  }
  cout << result.size() + resultRev.size() << endl;
  cout << result << resultRev << endl;
  return 0;
}
