#include <bits/stdc++.h>
using namespace std;
bool ExistsIn(string, string);
int main() {
  int N;
  string ans, temp[100], realanswer = "";
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> temp[i];
  }
  for (int z = 0; z < N; z++) {
    ans = temp[z];
    for (int y = 0; y < N; y++) {
      for (int i = 0; i < N; i++) {
        if (ExistsIn(temp[i], ans)) {
          ans = temp[i];
        } else if (!ExistsIn(ans, temp[i])) {
          int k;
          for (k = 0; k < temp[i].length(); k++) {
            bool exist = true;
            for (int m = 0; m < ans.length(); m++) {
              if (ans[m] != temp[i][k + m] && k + m < temp[i].length()) {
                exist = false;
                break;
              }
            }
            if (exist) break;
          }
          if (k == temp[i].length()) {
            for (k = temp[i].length() - 1; k >= 0; k--) {
              bool exist = true;
              for (int m = 0; m < ans.length(); m++) {
                if (ans[ans.length() - m - 1] != temp[i][k - m] && k - m >= 0) {
                  exist = false;
                  break;
                }
              }
              if (exist) break;
            }
            if (k == -1) {
            } else {
              for (int c = k + 1; c < temp[i].length(); c++) {
                ans += temp[i][c];
              }
            }
          } else {
            string real = "";
            for (int c = 0; c < k; c++) {
              real += temp[i][c];
            }
            ans = real + ans;
          }
        }
      }
    }
    if (!ExistsIn(realanswer, ans)) realanswer += ans;
  }
  cout << realanswer;
  return 0;
}
bool ExistsIn(string ans, string temp) {
  for (int i = 0; i < ans.length(); i++) {
    if (i + temp.length() <= ans.length()) {
      bool exist = true;
      for (int k = 0; k < temp.length(); k++) {
        if (ans[i + k] != temp[k]) {
          exist = false;
          break;
        }
      }
      if (exist) return true;
    } else
      break;
  }
  return false;
}
