#include <bits/stdc++.h>
using namespace std;
string append(string &answer, string &temp, int posBeg) {
  int posEnd = answer.find_last_of(temp);
  if (posBeg == 0)
    if (posEnd == answer.size() - 1)
      return temp;
    else
      return temp + answer.substr(posEnd + 1);
  else if (posEnd < answer.size() - 1)
    return answer;
  else
    return answer.substr(0, posBeg) + temp;
}
int main() {
  int n;
  cin >> n;
  vector<string> vec;
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    bool added = false;
    for (int j = 0; j < vec.size(); j++) {
      int pos = vec[j].find_first_of(temp);
      if (pos != string::npos) vec[j] = append(vec[j], temp, pos), added = true;
    }
    vec.push_back(temp);
  }
  for (int i = 0; i < n; i++)
    if (vec[i] != "")
      for (int j = 0; j < n; j++)
        if (vec[j] != "" && i != j) {
          int pos = vec[i].find_first_of(vec[j]);
          if (pos != string::npos) {
            vec[i] = append(vec[i], vec[j], pos);
            vec[j] = "";
            vec[j].shrink_to_fit();
          }
        }
  for (int i = 0; i < n; i++) cout << vec[i];
}
