def fold(dots: set, folding: tuple) -> set:
    """Return set of dots after folding."""
    axis, line = folding
    folded = set()
    for x, y in dots:
        # update x/y coordinate if right of/below the folding line
        if axis == 'x':
            folded.add( (x if x < line else 2*line-x, y))
        else:
            folded.add( (x, y if y < line else 2*line-y))
    return folded