_='' d=x=0 for c in raw_input()+' ': if d:print _;_=' '*x _+=c;d^=c<_;x+=d^1