A=[input().split()for i in' '*int(input())]A.sort(key=lambda x:-float(x[1]))print(*[k for k,v in A])
4 word .15 pepsi 4.6 anotherword 1.6 bus 3
pepsi bus anotherword word
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!