#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

ll N, L;
string S[1000];

int main(void) {
  cin >> N >> L;
  REP(i, 0, N) cin >> S[i];

  sort(S, S + N);

  ll p[1000];
  REP(i, 0, N) p[i] = -1;
  REP(i, 0, N) if(p[i] == -1) {
    // string s = reverse(S[i].begin(), S[i].end());
    string s = "";
    REP(j, 0, S[i].size()) s += S[i][S[i].size() - j - 1];
    // cout << S[i] << " " << s << endl;
    REP(j, i + 1, N) if(p[j] == -1) {
      if(s == S[j]) {
        p[i] = j;
        p[j] = i;
        break;
      }
    }
  }

  string ans = "";
  vector<string> mid;
  REP(i, 0, N) if(p[i] >= 0) {
    ans += S[i];
    p[p[i]] = -2;
  } else if(p[i] == -1) {
    bool f = true;
    REP(j, 0, S[i].size()) f = f && S[i][j] == S[i][S[i].size() - j - 1];
    if(f) mid.push_back(S[i]);
  }
  sort(mid.begin(), mid.end());

  // cout << (ans + reverse(ans.begin(), ans.end())) << endl;
  cout << ans;
  if(mid.size() > 0) cout << mid[0];
  REP(i, 0, ans.size()) cout << ans[ans.size() - i - 1];
  cout << endl;
}