#include <bits/stdc++.h>
using namespace std;
typedef long long in;
bool cmp(string x,string y)
{
	in lenx=x.size();
	in leny=y.size();
	if(lenx>leny)
	{
		return 1;
	}else if(lenx<leny){
		return 0;
	}else{
		for(in i=0;i<x.size();i++)
		{
			if(x[i]>y[i])
			{
				return 1;
			}
			else if(x[i]<y[i])
			{
				return 0;
			}
		}
		return 0;
	}
}
int main() {
	vector <string> a;
	string m;
	in t=0;
	while(true)
	{
		t++;
		cin>>m;
		if(m==".")
		{
			break;
		}else{
			a.push_back(m);
		}
	}
	sort(a.begin(),a.end(),cmp);
	for(in i=0;i<t-1;i++)
	{
		cout<<a[i]<<' ';
	}
    return 1;
}

1 条评论

  • 1