#include <bits/stdc++.h>
using namespace std;
string s[202];
int was[202][26];
bool used[202];
char c;
int n;
string merg(int q1, int q2, int ch) {
  string ans = "";
  if (was[q1][ch] > was[q2][ch]) {
    for (int w = 0; w < was[q1][ch]; w++) {
      ans.push_back(s[q1][w]);
    }
  } else {
    for (int w = 0; w < was[q2][ch]; w++) {
      ans.push_back(s[q2][w]);
    }
  }
  if (s[q1].size() - was[q1][ch] > s[q2].size() - was[q2][ch]) {
    for (int w = was[q1][ch]; w < s[q1].size(); w++) {
      ans.push_back(s[q1][w]);
    }
  } else {
    for (int w = was[q2][ch]; w < s[q2].size(); w++) {
      ans.push_back(s[q2][w]);
    }
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    for (int j = 0; j < 26; j++) {
      was[i][j] = -1;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < 26; j++) {
      was[i][j] = -1;
    }
    for (int j = 0; j < s[i].size(); j++) {
      was[i][s[i][j] - 'a'] = j;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (used[i] || used[j]) {
        continue;
      }
      for (int u = 0; u < 26; u++) {
        if (was[i][u] != -1 && was[j][u] != -1) {
          used[i] = true;
          used[j] = true;
          s[n] = merg(i, j, u);
          used[n] = false;
          for (int j = 0; j < s[n].size(); j++) {
            was[n][s[n][j] - 'a'] = j;
          }
          n++;
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      cout << s[i];
    }
  }
  return 0;
}
