i=0 r=1 while 1: for w in raw_input().split():l=len(w);print" "*(i+r/2*l)+w[::r];i+=r*l;r=-r