#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64777216")
using namespace std;
const long long maxn = 101;
const long long maxq = 1000001;
const long long maxseg = 262144;
const long long secret_number = -87468267;
const pair<int, int> secret_pair = make_pair(secret_number, secret_number);
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const int iinf = 2147483647 / 2;
const double pi = 3.141592653589793238462643383279502884;
const double eps = 1e-7;
const string something_very_long =
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    "aaaaaaaa";
const string govno = "g";
pair<int, int> get_pos(string &a, string &b) {
  for (int i = 0; i < a.length(); ++i)
    for (int j = 0; j < b.length(); ++j)
      if (a[i] == b[j]) return pair<int, int>(i, j);
  return secret_pair;
}
pair<string, string> get_parts(string &a, int pos) {
  return pair<string, string>(a.substr(0, pos + 1),
                              a.substr(pos + 1, a.length() - pos));
}
string lenmax(string &a, string &b) {
  if (a.length() > b.length())
    return a;
  else
    return b;
}
string unite(string a, string b, pair<int, int> pos) {
  pair<string, string> parts_a = get_parts(a, pos.first);
  pair<string, string> parts_b = get_parts(b, pos.second);
  return lenmax(parts_a.first, parts_b.first) +
         lenmax(parts_a.second, parts_b.second);
}
int main() {
  bool f[maxn];
  string a[maxn];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) f[i] = true, cin >> a[i];
  for (int k = 0; k < n; ++k)
    for (int i = 0; i < n; ++i)
      for (int j = i + 1; j < n; ++j)
        if (f[i] && f[j]) {
          pair<int, int> pos = get_pos(a[i], a[j]);
          if (pos == secret_pair) continue;
          f[j] = false;
          a[i] = unite(a[i], a[j], pos);
        }
  string res = "";
  for (int i = 0; i < n; ++i)
    if (f[i]) res += a[i];
  cout << res;
  return 0;
}
