#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long SZ = 500010;
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-6;
const long long MUL = 239017;
set<string> tg;
string a, c;
bool v[26];
string glue(string a, string b) {
  if (b.length() > a.length()) swap(a, b);
  c = "";
  for (int i = 0; i < 26; i++) v[i] = false;
  for (char i : a) v[i - 'a'] = true;
  for (char i : b)
    if (!v[i - 'a']) c += i;
  if (v[b[0] - 'a'])
    a = a + c;
  else
    a = c + a;
  return a;
}
int main() {
  srand(330699524);
  ios::sync_with_stdio(false);
  cout.precision(20);
  int n;
  cin >> n;
  while (n--) {
    cin >> a;
    tg.insert(a);
  }
  bool c = true;
  while (c) {
    c = false;
    auto it1 = tg.begin();
    while (it1 != tg.end()) {
      auto it2 = tg.begin();
      while (it2 != tg.end()) {
        if (it1 != it2) {
          a = glue(*it1, *it2);
          if (a.length() < (*it1).length() + (*it2).length()) {
            tg.erase(it1);
            tg.erase(it2);
            tg.insert(a);
            c = true;
          }
        }
        if (c) break;
        it2++;
      }
      if (c) break;
      it1++;
    }
  }
  for (string i : tg) cout << i;
  return 0;
}
