Sort:  

to find length of train b