Easy - just define the minimum row period. A line periodic over the minimum period K will produce the same (and therefore lexicographically equal) lines for exactly N/K different rotations, therefore, whatever the lexicographic minimum, this will be the result of N/K different rotations.
Sneftel
source share