#include <bits/stdc++.h>
using namespace std;
string concat(string A, string B, int n, int _nucs[26]) {
  string tmp = "";
  for (int i = 0; A[i] != B[0]; ++i) {
    tmp.push_back(A[i]);
    if (i > 0) _nucs[A[i] - 'a'] = n;
  }
  for (int j = 0; j < B.length(); ++j) {
    tmp.push_back(B[j]);
    if (j < B.length() - 1) _nucs[B[j] - 'a'] = n;
  }
  return tmp;
}
int main() {
  string tmp;
  vector<string> parts = vector<string>();
  int n, nucs[26];
  cin >> n;
  getline(cin, tmp);
  for (int i = 0; i < n; ++i) {
    getline(cin, tmp);
    parts.push_back(tmp);
  }
  for (int i = 0; i < 26; ++i) nucs[i] = -1;
  for (int i = 0; i < n; ++i) {
    if (parts[i].length() == 1) {
      if (nucs[parts[i][0] - 'a'] == -1)
        nucs[parts[i][0] - 'a'] = i;
      else
        continue;
    } else {
      if (nucs[parts[i][0] - 'a'] ==
              nucs[parts[i][parts[i].length() - 1] - 'a'] &&
          nucs[parts[i][0] - 'a'] != -1)
        continue;
      for (int j = 1; j < parts[i].length() - 1; ++j)
        nucs[parts[i][j] - 'a'] = i;
      if (nucs[parts[i][0] - 'a'] != -1) {
        parts[i] = concat(parts[nucs[parts[i][0] - 'a']], parts[i], i, nucs);
        nucs[parts[i][0] - 'a'] = i;
      } else
        nucs[parts[i][0] - 'a'] = i;
      if (nucs[parts[i][parts[i].length() - 1] - 'a'] != -1) {
        parts[i] =
            concat(parts[i], parts[nucs[parts[i][parts[i].length() - 1] - 'a']],
                   i, nucs);
        nucs[parts[i][parts[i].length() - 1] - 'a'] = i;
      } else
        nucs[parts[i][parts[i].length() - 1] - 'a'] = i;
    }
  }
  int* out = new int[n];
  for (int i = 0; i < n; ++i) out[i] = 0;
  for (int i = 0; i < 26; ++i)
    if (nucs[i] != -1) out[nucs[i]] = 1;
  for (int i = 0; i < n; ++i)
    if (out[i] == 1)
      for (int j = 0; j < parts[i].length(); ++j) cout << parts[i][j];
  delete[] out;
  return 0;
}
