1204 01串排序


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

将01串首先按长度排序,长度相同时,按1的个数多少进行排序,1的个数相同时再按ASCII码值排序。

Input

输入数据中含有一些01串,01串的长度不大于256个字符。

Output

重新排列01串的顺序。使得串按基本描述的方式排序。

Sample

Input

10011111
00001101
1010101
1
0
1100

Output

0
1
1100
1010101
00001101
10011111

Source: qianneng


Comments

There are no comments at the moment.