def sort(a): for k in range(len(a)): (a[k][0],a[k][1]) = (a[k][1],a[k][0]) a.sort() for k in range(len(a)): (a[k][0],a[k][1]) = (a[k][1],a[k][0])a = [[1,