```
class Solution(object):
def reconstructQueue(self, people):
people.sort(cmp = lambda x, y: -1 if (x[0] > y[0] or (x[0]==y[0] and x[1]<y[1])) else 1)
res = []
for p in people:
res.insert(p[1],p)
return res
```