Sort the max number in martix.