#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  for (string& s : v) cin >> s;
  for (char ch = 'a'; ch <= 'z'; ch++) {
    char bs[100];
    const int i = 49;
    int mn = i, mx = i;
    string* ps = 0;
    for (string& s : v) {
      if (s.empty()) continue;
      int j = 0;
      for (; j < (int)s.size(); j++) {
        if (s[j] == ch) break;
      }
      if (j == s.size()) continue;
      int k, m;
      for (k = j, m = i; k >= 0; --k, --m) {
        bs[m] = s[k];
      }
      mn = min(mn, m + 1);
      for (k = j, m = i; k < (int)s.size(); ++k, ++m) {
        bs[m] = s[k];
      }
      mx = max(mx, m - 1);
      s.clear();
      ps = &s;
    }
    *(bs + 1 + mx) = 0;
    if (ps) *ps = bs + mn;
  }
  string res;
  for (string& s : v) {
    if (s.size()) res += s;
  }
  cout << res << '\n';
}
