s=raw_input()\x0d l,r=divmod(len(s),4)\x0d if r:l+=1;s+=" "*(r-2)\x0d for i in range(l+1):\x0d if not i:print s[:l+1]\x0d elif i<l:print s[-i]+" "*(l-1)+s[l+i]\x0d else:print s[3*l:2*l-1:-1]
Note that non-ascii characters in the above source code will be escaped (such as \x9f).