#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;

map<string, int> frequency(const vector<string> &s) {
  map<string, int> ret;
  REP(i, 0, s.size()) {
    ret[s[i]] += 1;
  }
  return ret;
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  vector<string> pal, nonpal;
  REP(i, 0, n) {
    cin >> s[i];
    string rev(s[i]);
    reverse(rev.begin(), rev.end());
    if (rev == s[i]) {
      pal.push_back(s[i]);
    } else {
      nonpal.push_back(s[i]);
    }
  }
  map<string, int> fpal = frequency(pal), fnonpal = frequency(nonpal);
  vector<string> peri;
  const string dummy = "\x7e";
  string centre = dummy;
  for (map<string, int>::iterator it = fpal.begin(); it != fpal.end(); ++it) {
    pair<string, int> v = *it;
    string s = v.first;
    int f = v.second;
    if (f % 2 == 1) {
      centre = min(centre, s);
    }
    REP(i, 0, f / 2) {
      peri.push_back(s);
    }
  }
  for (map<string, int>::iterator it = fnonpal.begin(); it != fnonpal.end(); ++it) {
    pair<string, int> v = *it;
    string s = v.first;
    string rev = s;
    reverse(rev.begin(), rev.end());
    if (s >= rev) {
      continue;
    }
    // s < rev
    int f = min(fnonpal[s], fnonpal[rev]);
    REP(i, 0, f) {
      peri.push_back(s);
    }
  }
  sort(peri.begin(), peri.end());
  REP(i, 0, peri.size()) {
    cout << peri[i];
  }
  if (centre != dummy) {
    cout << centre;
  }
  REP(i, 0, peri.size()) {
    string rev = peri[peri.size() - 1 - i];
    reverse(rev.begin(), rev.end());
    cout << rev;
  }
  cout << "\n";
}