#include <bits/stdc++.h>
using namespace std;
string s[301];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j) {
        int N = s[i].size(), M = s[j].size();
        char A = s[i][N - 1], B = s[j][M - 1];
        if (s[i].find(B) < N) {
          if (s[i].find(s[j]) < N)
            s[j] = "";
          else {
            for (int k = s[i].find(B) + 1; k < N; k++) s[j] += s[i][k];
            s[i] = "";
          }
        } else if (s[j].find(A) < M) {
          if (s[j].find(s[i]) < M) {
            s[i] = "";
          } else {
            for (int k = s[j].find(A) + 1; k < M; k++) s[i] += s[j][k];
            s[j] = "";
          }
        }
      }
    }
  }
  string t;
  for (int i = 0; i < n; i++) t += s[i];
  cout << t;
}
