def max_water_container(height):
    left, right = 0, len(height) - 1
    max_water = 0

    while left < right:
        # Calculate the area between the two lines
        water = min(height[left], height[right]) * (right - left)
        max_water = max(max_water, water)

        # Move the pointer pointing to the shorter line
        if height[left] < height[right]:
            left += 1
        else:
            right -= 1

    return max_water

# Taking user input with validation
try:
    height = list(map(int, input("Enter heights separated by spaces: ").split()))

    # Constraints validation
    if not (2 <= len(height) <= 10**5):
        print("Error: The number of heights must be between 2 and 100000.")
    elif any(h < 0 or h > 10**4 for h in height):
        print("Error: Heights must be between 0 and 10000.")
    else:
        print("Maximum water volume:", max_water_container(height))

except ValueError:
    print("Error: Please enter valid integers.")
