Shortest repetition