n=0;m=1 while 1: for x in raw_input().split():s=" "*n;n+=m*len(x);print s[:n]+x[::m];m=-m