#import int i,j;main(){for(std::string m[999];cin>>m[i];j=j>i?cout<