w,_,c=raw_input();w=int(w) s=c+" "*w i=0 exec'print i/2*" "+(s[:-i-3]+s[:i])*~-w+c;i+=2;'*w