The min-max composition is a suitable operation for this case.
we first take the minimum value from the function Word for each possibility of segmentation, and then we choose the maximum from the selected minimums.