i=b=0;s="" for c in raw_input():s+=i*('\n'+~-b*' ')+c;b+=i^1;i^=c<'A' print s