#include <bits/stdc++.h>
using namespace std;
int i, n, j, m, gmb, freq[30];
bool u;
string s, aux, a[105];
vector<string> rs;
bool Check(const string &a, const string &b) {
  int i, j, n = a.length(), m = b.length();
  for (i = 0; i + m - 1 < n; ++i) {
    for (j = 0; j < m; ++j)
      if (a[i + j] != b[j]) j = 1e9;
    if (j < 1e5) return 1;
  }
  return 0;
}
string Unite(int x, int y) {
  int pozx = -1, pozy = -1, i;
  string aux;
  for (i = 0; i < (int)a[x].size() && pozx < 0; ++i)
    if (a[x][i] == a[y][0]) pozx = i;
  for (i = 0; i < (int)a[y].size() && pozy < 0; ++i)
    if (a[x][0] == a[y][i]) pozy = i;
  if (pozx + pozy == -2) return a[x] + a[y];
  if (Check(a[x], a[y])) return a[x];
  if (Check(a[y], a[x])) return a[y];
  if (pozx > -1) {
    for (i = 0; i < pozx; ++i) aux += a[x][i];
    return aux + a[y];
  }
  for (i = 0; i < pozy; ++i) aux += a[y][i];
  return aux + a[x];
}
bool Check(int x, int y) {
  for (int i = 0; i < (int)a[x].size(); ++i)
    for (int j = 0; j < (int)a[y].size(); ++j)
      if (a[x][i] == a[y][j]) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  while (n > 1) {
    for (i = u = 1; i <= n; ++i)
      for (j = i + 1; j <= n; ++j)
        if (Check(i, j)) {
          a[i] = Unite(i, j);
          swap(a[j], a[n]);
          --n;
          u = 0;
        }
    if (u) a[1] = Unite(1, n), --n;
  }
  cout << a[1] << '\n';
  return 0;
}
