#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<string>s;
int n;
string t,ans;
int main(){
	while(cin>>n,n){
		set<string>ss;
		ans="zzzzzzzzzzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
		int p=0;
		vector<int>v;
		s.clear();
		r(i,n){
			cin>>t;
			if(!ss.count(t)){
				s.push_back(t);
				ss.insert(t);
			}
		}
		r(i,s.size())r(j,s.size())if(i!=j&&s[i].size()>=s[j].size()){
			r(k,s[i].size()){
				int sum=0;
				if(k+s[j].size()<=s[i].size()){
				for(int l=k;l-k<s[j].size();l++)
					if(s[i][l]==s[j][l-k])sum++;
				if(sum==s[j].size()){
					v.push_back(j);
					break;
				}
			}}
		}
		sort(v.begin(),v.end());
		v.erase(unique(v.begin(),v.end()),v.end());
		r(i,v.size()){
			s.erase(s.begin()+v[i]+p);
			p--;n--;
		}
		sort(s.begin(),s.end());
		do{
			t="";
			t+=s[0];
			for(int i=1;i<s.size();i++){
				int sum=0;
				for(int j=s[i-1].size()-1;j>=0;j--){
					int sum2=0,cnt=0;
					for(int k=0;;k++){
						if(k+j>=s[i-1].size())break;
						if(s[i][k]==s[i-1][j+k])sum2++;
						else goto L;
					}
					if(!cnt)sum=max(sum,sum2);L:;
				}
				t+=s[i].substr(sum);
			}
			if(ans.size()>t.size())ans=t;
			else if(ans.size()==t.size()) ans=min(ans,t);
		}while(next_permutation(s.begin(),s.end()));
		cout<<ans<<endl;
	}
}