s=t='' for c in raw_input()+' ': t+=c if'A'>c:s+="%u_"%~-len(t)*(t>c)+t;t='' print s