#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

bool contains(const string &a, const string &b){
	if( a.find( b ) != string::npos ){
		return true;
	}else
		return false;
}

bool mystrcmp(const string &a, const string &b){
	return a.compare(b) < 0;
}

bool strless(const string &a, const string &b){
	if( a.length() < b.length() )
		return true;
	else if( a.length() == b.length() && mystrcmp( a, b ) )
		return true;
	else
		return false;
}

string overwrap( const string &a, const string &b ){
	unsigned int len = 0;
	unsigned int min_len = min( a.length(), b.length() );
	string ret = a;
	
	for(unsigned int i = min_len; i >= 1; --i){
		bool bOk = true;
		for(unsigned int j = 0; j < i; ++j){
			if( a[ a.length() - i + j ] != b[ j ] ){
				bOk = false;
			}
		}
		if( bOk ){
			len = i;
			break;
		}
	}

	ret += b.c_str() + len;

	return ret;
}

void solve( vector< string > &vs, string &ans ){
	sort( vs.begin(), vs.end(), mystrcmp );
	
	for(unsigned int i = 0; i < vs.size(); ++i){
		for(unsigned int j = 0; j < vs.size(); ++j){
			if( i != j ){
				if( contains( vs[i], vs[j] ) ){
					vs.erase( vs.begin() + j );
					i = -1;
					break;
				}
			}
		}
	}

	for(unsigned int i = 0; i < vs.size(); ++i){
		for(unsigned int j = 0; j < vs.size(); ++j){
			if( i != j ){
				int diff = (vs[i]+vs[j]).length() - (overwrap(vs[i],vs[j])).length();
				if( diff > 0 ){
					vector<string> tvs(vs.begin(),vs.end());
					
					tvs[i]=overwrap(tvs[i],tvs[j]);
					tvs.erase( tvs.begin() + j );
					solve( tvs, ans );
				}
			}
		}
	}		
	
	for(unsigned int i = 1; i < vs.size(); ++i){
		vs[0] += vs[i];
	}

	if( strless( vs[0], ans ) )
		ans = vs[0];
}

int main(){
	while(true){
		int n;
		string ans;
		vector<string> vs;
		
		scanf("%d", &n);

		if( n == 0 )
			break;

		for(int i = 0; i < n; ++i){
			string s;
			cin>>s;
			vs.push_back(s);
			ans+=s;
		}

		solve( vs, ans );

		cout << ans << endl;
	}
	return 0;
}