f={v->v&&[f(p[v]),p[v+=j]||[p[v]=j,a<2e3?[o=p[n]+' '+o,n=l<'t'?p[n]:n-1][1]>1:f(j=a[i++]);); print o