for(n=1,m=0;;)for each(s in readline().split(' ')){r='';for(i in s)r=s[i]+r;print(Array(n-=m*i).join(' ')+(m?r:s));m=!m;n+=m*i}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page