#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<queue>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define mmt(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define y1 fuck
#define N 110
#define TS 8201
using namespace std;
typedef long long LL;
typedef long double LD;
int full,fa[N][TS][2],dp[N][TS],n,len[N][N],ee=0,rank[N][N];
bool b[N];string list[N],s[N],str[N],c[N][N];
struct dat{string St;int x,y;}d[N*N];
bool cmp(dat a,dat b){return a.St<b.St;}
int instr(string a,string b)
{
  //1-b in a
  if (a.find(b)!=string::npos) return 1;
  if (b.find(a)!=string::npos) return 2;
  return 0;
}
bool check(int x,string a,string b)
{
  bool f=1;int i;
  int sa=a.size()-x;
  FOR(i,0,x-1)
  {
    if (a[sa+i]!=b[i]) {f=0;break;}
  }
  return f;
}
string make(int &L,string a,string b)
{
  int i,p;string tmp=a;
  L=a.size()+b.size();
  ROF(i,min(a.size(),b.size()),0)
  {
    if (check(i,a,b)) {p=i;break;}
  }
  L-=p;
  FOR(i,p,(int)b.size()-1) tmp+=b[i];
  return tmp;
}
void output(int p)
{
  int now=p,i=0,st=full,tnow,tst;
  while (now!=0)
  {
    list[++i]=s[now];
    tnow=fa[now][st][0];
    tst=fa[now][st][1];
    now=tnow;st=tst;
  }
  string ans=list[1],tmp;
  int le,j;
  FOR(i,2,n)
  {
    make(le,ans,list[i]);
    le=ans.size()+list[i].size()-le;
    FOR(j,le,list[i].size()-1)
    {
      ans+=list[i][j];
    }
  }
  cout<<ans<<endl;
}
int main()
{
  ios::sync_with_stdio(false);
  cin>>n;int i,j,k;
  FOR(i,1,n) cin>>str[i];
  FOR(i,1,n) FOR(j,i+1,n) 
  if (!b[i]&&!b[j])
  {
    int f=instr(str[i],str[j]);
    if (!f)
    {
      if (f==1) b[j]=0;else b[i]=0;
    }
  }
  int tn=0;
  FOR(i,1,n)
   if (!b[i]) s[++tn]=str[i];
  s[0]=""; 
  n=tn;
  FOR(i,0,n)
  {
    FOR(j,0,n)
     if (i!=j)
     {
       c[i][j]=make(len[i][j],s[i],s[j]);
       d[++ee].St=c[i][j];
       d[ee].x=i;
       d[ee].y=j;
     }
  }
  sort(d+1,d+1+ee,cmp);
  FOR(i,1,ee)
  {
    rank[d[i].x][d[i].y]=i;
  }
  full=(1<<n)-1;
  mmt(dp,20);dp[0][0]=0;
  FOR(i,1,full)
  {
    FOR(j,1,n)
     if (i>>(j-1)&1)
     {
       //[j,i]<-[k,i-(1<<(j-1))]
       FOR(k,0,n)
       {
         int tmp=dp[k][i-(1<<(j-1))]+len[j][k]-s[k].size();
         if (tmp<dp[j][i]) {dp[j][i]=tmp;fa[j][i][0]=k;fa[j][i][1]=i-(1<<(j-1));}
         if (tmp==dp[j][i])
         {
           int oldk=fa[j][i][0];
           if (rank[j][k]<rank[j][oldk])
           {
             fa[j][i][0]=k;fa[j][i][1]=i-(1<<(j-1));
           }
         }
       }
     }
  }
  int p,Min=1e9,mrnk=1e9,Fa;
  FOR(i,1,n)
  {
    Fa=fa[i][full][0];
    if (dp[i][full]<Min) 
    {
      Min=dp[i][full];p=i;
      mrnk=rank[i][Fa];
    }else
    if (dp[i][full]==Min)
    {
      if (rank[i][Fa]<mrnk)
      {
        mrnk=rank[i][Fa];p=i;
      }
    }
  }
  output(p);
  return 0;
}