"""
Created on: Wed Mar  8 12:47:55 2023
Author: vila@cs.upc.edu
"""

def balla(L, i):
    while 0 <= i < len(L):
        yield i
        i = i+L[i]
