import sys\x0d s=sys.stdin.readline()\x0d n=int(s[1:])+1\x0d T=[0]*n\x0d q=[1]\x0d d=lambda z:d(T[z])+[z]if z else[]\x0d for x in q:\x0d a=[];z=x\x0d while z:\x0d y=x+z\x0d if y<n and T[y]==0:a+=[y];T[y]=x\x0d z=T[z]\x0d q.extend(a[::-1])\x0d a=[d(n-1),T[2:]][s[0]=='t']\x0d for t in a:print t,
Note that non-ascii characters in the above source code will be escaped (such as \x9f).