File standardInput readLines map(x,i:=1 while(x findSeq("d ")<1,x=x slice(2) i=i+1)i repeat(x println))