while 1: t=[[]];l=0 for e in input():t[-1]+=[e]*(e>=l);t+=[[e]]*(e