output the shortest subsegment