_,a,b=`dd`.split f=->n{b[n]e{e<0?i:g[e+d*f[i+=d]]} p g[0]+1