def top(rect):
    """Returns the top most Y value of the rectangle.

    This caters for rectangles with a negative height.

    :rtype: float
    :return: The biggest Y value.
    """
    return max(rect[0][1], rect[0][1] + rect[1][1])
