def dancing_rook(L, i0):
    dL = []
    i = i0
    while -len(L) <= i < len(L) and L[i] != '.':
        dL.append(i)
        L[i], i = '.', i+L[i]
    return dL
