#include #include #include using namespace std; int main(){ priority_queue,greater >q; int N; for(cin>>N;N--;){ string s; cin>>s; q.push(s+'~'); } string t; for(;!q.empty();){ string s=q.top();q.pop(); t+=s[0]; if(s.size()>2)q.push(s.substr(1)); } cout<