int N; string S[60]; string T; void solve() { int i,j,k,l,r,x,y; string s; cin>>N; FOR(i,N) cin>>S[i], S[i]+="{"; while(1) { x=-1; FOR(i,N) if(S[i].size()>1) { if(x==-1 || S[x]>S[i]) x=i; } if(x==-1) break; T+=S[x][0]; S[x]=S[x].substr(1); } cout<