If you know the max value as M, then you can do:
augmented_a = a.select(1, 0) * M + a.select(1, 1)
ind = augmented_a.sort().indices

res = a.index_select(0, ind)

(I didn’t test it but that should work )
If you don’t know the max, you can play similar tricks if you have a max number of digit and converting them to strings