def intersection(u1, u2, v1, v2):
    """
    return the intersection of (u1, u2) and (v1, v2) or None if no intersection

    Example:

    intersec = intersection(0, 3, 2, 5)
    if intersec is not None:
        x0, x1 = intersec    --> 2, 3

    """
    x0 = u1 if u1 > v1 else v1
    x1 = u2 if u2 < v2 else v2
    return (x0, x1) if x0 < x1 else None
