def minbox(points):
    """Returns the minimal bounding box necessary to contain points

    Args:
        points (tuple, list, set): ((0,0), (40, 55), (66, 22))

    Returns:
        dict: {ulx, uly, lrx, lry}

    Example:
        >>> minbox((0, 0), (40, 55), (66,22))
        {'ulx': 0, 'uly': 55, 'lrx': 66, 'lry': 0}
    """

    x, y = [point[0] for point in points], [point[1] for point in points]
    return {'ulx': min(x), 'lrx': max(x), 'lry': min(y), 'uly': max(y)}