minimum lexicographical rotation