#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> c;
string cur;
pair<string, vector<int> > A;
void mer() {
  int l, r;
  l = r = 2147483647;
  for (int i = 0; i < cur.size(); ++i) {
    if (cur[i] == A.first[0]) l = i;
    if (cur[i] == A.first[A.first.size() - 1]) r = i;
  }
  if (l != 2147483647 && r != 2147483647) return;
  if (l == 2147483647 && r == 2147483647) {
    c = A.second;
    cur = A.first;
    return;
  }
  if (r == 2147483647) {
    int k = cur.length() - l;
    for (int i = k; i < A.first.length(); ++i)
      cur += A.first[i], c[A.first[i] - 'a'] = true;
    return;
  }
  for (int i = r + 1; i < cur.length(); ++i) {
    A.first += cur[i];
    A.second[cur[i] - 'a'] = true;
  }
  c = A.second;
  cur = A.first;
  return;
}
vector<pair<string, vector<int> > > S;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> cur;
    c.clear();
    c.resize(26, 0);
    for (int j = 0; j < cur.size(); ++j) c[cur[j] - 'a'] = true;
    for (int j = S.size() - 1; j >= 0; --j) {
      for (int k = 0; k < 26; ++k)
        if (S[j].second[k] && c[k]) {
          A = S[j];
          mer();
          swap(S[j], S.back());
          S.pop_back();
          break;
        }
    }
    S.push_back(make_pair(cur, c));
  }
  for (int i = 0; i < S.size(); ++i) cout << S[i].first;
  return 0;
}
