#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline string getStr() {
  char ch[1000000];
  scanf("%s", ch);
  return ch;
}
inline string getStr2() {
  char ch[5];
  scanf("%s", ch);
  return ch;
};
template <class P, class Q>
inline P smin(P &a, Q b) {
  if (b < a) a = b;
  return a;
}
template <class P, class Q>
inline P smax(P &a, Q b) {
  if (a < b) a = b;
  return a;
}
const long long MAX_N = 3e5 + 10;
const long long MOD = 1e9 + 7;
inline long long gcd(long long a, long long b) {
  return b == 0 ? a : gcd(b, a % b);
}
inline char getCh() {
  char ch;
  scanf(" %c", &ch);
  return ch;
}
string s[MAX_N];
int32_t main() {
  long long n = in();
  for (long long i = 0; i < n; i++) s[i] = getStr();
  for (long long i = 0; i < n; i++) {
    if (s[i] == "#") continue;
    for (long long j = 0; j < n; j++) {
      if (i == j || s[j] == "#") continue;
      for (long long pt = 0; pt < s[j].size(); pt++) {
        for (long long pt2 = 0; pt2 < s[i].size(); pt2++) {
          if (s[i][pt2] == s[j][pt]) {
            long long right = pt, left = pt2;
            while (left < s[i].size() && right < s[j].size() &&
                   s[i][left] == s[j][right]) {
              left++, right++;
            }
            s[i] = s[i].substr(0, pt2) + s[j] + s[i].substr(left, s[i].size());
            s[j] = "#";
            j = -1;
            pt = 1e5, pt2 = 1e5;
            break;
          }
        }
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == "#") continue;
    cout << s[i];
  }
}
