#include <bits/stdc++.h>
using namespace std;
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
char res[105];
int off = 55;
set<string> s;
vector<string> ans;
string get_next() {
  for (set<string>::iterator it = s.begin(); it != s.end(); it++) {
    string str = *it;
    for (int i = 0; i < 100; i++) {
      if (res[i] != 0) {
        for (int j = 0; j < str.size(); j++) {
          if (str[j] == res[i]) {
            s.erase(it);
            return str;
          }
        }
      }
    }
  }
  return string("");
}
void insert_str(string str) {
  for (int i = 0; i < 100; i++) {
    if (res[i] != 0) {
      for (int j = 0; j < str.size(); j++) {
        if (res[i] == str[j]) {
          for (int k = 0; k < str.size(); k++) res[i - j + k] = str[k];
          return;
        }
      }
    }
  }
}
string get_and_clear_buf() {
  string str;
  for (int i = 0; i < 100; i++) {
    if (res[i] != 0) {
      str.push_back(res[i]);
      res[i] = 0;
    }
  }
  return str;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    s.insert(str);
  }
  int rep = s.size();
  while (rep--) {
    string str = get_next();
    if (str == "") {
      string buf = get_and_clear_buf();
      if (buf != "") ans.push_back(buf);
      str = *s.begin();
      s.erase(s.begin());
      for (int i = 0; i < str.size(); i++) res[i + off] = str[i];
    } else {
      insert_str(str);
    }
  }
  string buf = get_and_clear_buf();
  if (buf != "") ans.push_back(buf);
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
  cout << "\n";
  return 0;
}
