w=s="" for x in raw_input()+" ": w+=x if"A">x:s+="%d_"%~-len(w)*(w>x)+w;w="" print s