#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
vector<string> F;
string merge(string a, string b, int idx1) {
  int i = 0;
  while (idx1 != (int)((a).size())) {
    i++;
    idx1++;
  }
  while (i < (int)((b).size())) {
    a.push_back(b[i]);
    i++;
  }
  return a;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) {
    char s[30];
    scanf("%s", s);
    F.push_back(s);
  }
  sort(F.begin(), F.end());
  F.assign(F.begin(), unique(F.begin(), F.end()));
  n = (int)((F).size());
  int i = 0;
  while (i + 1 != (int)((F).size())) {
    if (F[i][0] == F[i + 1][0])
      F.erase(F.begin() + i);
    else
      i++;
  }
  n = (int)((F).size());
  while (n != 1) {
    int ok = 0;
    for (int i = (0); i < (n); ++i) {
      for (int j = (0); j < (n); ++j) {
        if (i == j) continue;
        for (int idx1 = 0; idx1 < (int)((F[i]).size()); ++idx1) {
          if (F[i][idx1] == F[j][0]) {
            F[i] = merge(F[i], F[j], idx1);
            F.erase(F.begin() + j);
            n--;
            ok = 1;
            break;
          }
        }
        if (ok) break;
      }
      if (ok) break;
    }
    if (!ok) break;
  }
  for (string s : F) printf("%s", s.c_str());
  printf("\n");
  return 0;
}
