#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const long long maxn = (long long)2e3 + 10;
const long long maxm = (long long)20;
const int LOGN = 20;
const long long INF = 1e15 + 10;
const long long MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = 1e-12;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<string> a(n);
  for (int i = (0); i < ((n)); ++i) cin >> a[i];
  vector<string> b;
  for (int i = (0); i < ((n)); ++i) {
    bool find = false;
    for (int j = i + 1; j < n && !find; ++j) {
      string x = a[i];
      string y = a[j];
      if (x.find(y) != string::npos) {
        a[j] = x;
        find = true;
        break;
      }
      if (y.find(x) != string::npos) {
        find = true;
        break;
      }
      for (int k = (0); k < ((x.size())); ++k) {
        if (x[k] == a[j][0]) {
          a[j] = x.substr(0, k) + a[j];
          find = true;
          break;
        }
      }
      if (find) break;
      for (int k = (0); k < ((y.size())); ++k) {
        if (y[k] == a[i][0]) {
          a[j] = y.substr(0, k) + a[i];
          find = true;
          break;
        }
      }
    }
    if (!find) b.push_back(a[i]);
  }
  for (auto x : b) cout << x;
  cout << endl;
  return 0;
}
