s,n=input()k=nwhile k<=len(s):print s[k-n:k]+'\n'+s[k+n-1:k-1:-1].rjust(n);k+=2*n
"lefthgirt", 4
left righ
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!