s,z=eval(input());p=0while p<len(s):a=s[p:p+z].ljust(z);print(a[::-1] if p%(2*z) else a);p+=z
"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!