N,c=int(input()),1 A=[[-1 for _ in'1'*N] for _ in'1'*N] d=i=j=0 R=(0,1,0,-1,0) while c