mysort = lambda A, B: [t[1] for t in sorted(zip(B, A))]