def steps(start, instruction):
    """
    >>> list(steps((0, 0), "U3"))
    [(0, 1), (0, 2), (0, 3)]
    >>> list(steps((0, 0), "R3"))
    [(1, 0), (2, 0), (3, 0)]
    >>> list(steps((1, 1), "D4"))
    [(1, 0), (1, -1), (1, -2), (1, -3)]
    >>> list(steps((9, 3), "L1"))
    [(8, 3)]
    >>> list(steps((9, 9), "X1"))
    Traceback (most recent call last):
        ...
    ValueError: invalid direction 'X'
    """

    (x, y) = start
    direction = instruction[0]
    distance = int(instruction[1:])

    if direction == "U":
        return ((x, i) for i in range(y + 1, y + distance + 1))
    elif direction == "D":
        return ((x, i) for i in range(y - 1, y - distance - 1, -1))
    elif direction == "R":
        return ((i, y) for i in range(x + 1, x + distance + 1))
    elif direction == "L":
        return ((i, y) for i in range(x - 1, x - distance - 1, -1))
    else:
        raise ValueError("invalid direction '{}'".format(direction))