s,n=input()k=0while k<=len(s):print s[k:k+n].ljust(n)[::1-2*((k/n)%2)];k+=n
"Programming Puzzles & Code Golf", 4
Prog mmar ing zzuP les oC & de G flo
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!