N=int(input()) A=[[-1 for _ in range(N)] for _ in range(N)] d=c=i=j=0# it should be -1 to start with 0,0 while c