#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> vec;
vector<string> ans;
int main() {
  cin >> n;
  for (int(i) = 0; (i) < (n); i++) {
    string buf;
    cin >> buf;
    vec.push_back(buf);
  }
  vector<bool> used(n);
  for (int(i) = 0; (i) < (n); i++) {
    if (used[i]) continue;
    used[i] = true;
    string cur = vec[i];
    while (true) {
      bool goloop;
      goloop = false;
      for (int(j) = 0; (j) < (n); j++) {
        if (used[j]) continue;
        if (cur.find(vec[j]) != string::npos) {
          used[j] = true;
          continue;
        }
        if (vec[j].find(cur) != string::npos) {
          used[j] = true;
          cur = vec[j];
          goloop = true;
          continue;
        }
        int findHead = cur.find(vec[j][0]);
        int fildTail = cur.find(vec[j][vec[j].size() - 1]);
        if (findHead == string::npos && fildTail == string::npos) continue;
        if (findHead == string::npos) {
          cur = vec[j] + cur.substr(fildTail + 1);
          used[j] = true;
          goloop = true;
          continue;
        }
        if (fildTail == string::npos) {
          cur = cur.substr(0, findHead) + vec[j];
          used[j] = true;
          goloop = true;
          continue;
        }
      }
      if (!goloop) {
        ans.push_back(cur);
        break;
      }
    }
  }
  for (int(i) = 0; (i) < (ans.size()); i++) cout << ans[i];
  return 0;
}
