#include <bits/stdc++.h>
using namespace std;
int strcmpm(vector<string> *vec, int i1, int j1) {
  int num = 0;
  string si = (*vec)[i1], sj = (*vec)[j1], res;
  for (unsigned int i = 0; i < sj.length(); i++) {
    if (si[0] == sj[i]) {
      sj.length() - i > si.length() ? num = si.length() : num = sj.length() - i;
      break;
    }
  }
  if (num == 0) {
    for (unsigned int i = 0; i < si.length(); i++) {
      if (sj[0] == si[i]) {
        si.length() - i > sj.length() ? num = sj.length()
                                      : num = si.length() - i;
        break;
      }
    }
    if (num == 0)
      return 0;
    else {
      res = si;
      for (unsigned int i = num; i < sj.length(); i++) res += sj[i];
    }
  } else {
    res = sj;
    for (unsigned int i = num; i < si.length(); i++) res += si[i];
  }
  (*vec)[i1] = res;
  (*vec).erase((*vec).begin() + j1);
  return 1;
}
int main(void) {
  int n;
  string s;
  vector<string> vec;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    vec.push_back(s);
  }
  for (unsigned int i = 0; i < vec.size(); i++) {
    for (unsigned int j = i + 1; j < vec.size(); j++)
      if (strcmpm(&vec, i, j)) j = i;
  }
  s = "";
  for (unsigned int i = 0; i < vec.size(); i++) s += vec[i];
  cout << s;
  return 0;
}
