#include <bits/stdc++.h>
using namespace std;
map<char, string> home;
map<char, bool> was;
map<char, bool> was2;
int main() {
  int n = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    string* d = &home[s[0]];
    if (!d->empty()) {
      if (d->size() < s.size()) {
        *d = s;
      }
    } else
      *d = s;
  }
  string result;
  do {
    for (auto x : home) {
      for (int i = 0; i < x.second.length(); i++) {
        was[x.second[i]] = true;
      }
    }
    for (auto x : was) {
      was2[x.first] = true;
    }
    for (auto x : home) {
      for (int i = 1; i < x.second.length(); i++) {
        was2[x.second[i]] = false;
      }
    }
    char c;
    for (auto x : was2) {
      if (x.second == true) {
        c = x.first;
      }
    }
    result += home[c];
    home.erase(c);
    for (int i = 1; i < result.size(); i++) {
      string tm = home[result[i]];
      home.erase(result[i]);
      if (tm.size() > result.size() - i) {
        for (int j = result.size() - i; j < tm.size(); j++) {
          result += tm[j];
        }
      }
    }
    was.clear();
    was2.clear();
  } while (not home.empty());
  cout << result << endl;
  return 0;
}
