a = [7, 14, 0, 9, 19, 9]
b = [45, 42, 0, 1, -1, 0]
print(zip(*sorted(zip(sorted(b), sorted(enumerate(a), key=lambda x: x[1])),
    key=lambda x: x[1][0]))[0])
Putting a list in the same order as another list