#!/bin/python3 import sys n = int(input().strip()) def twoIntToString(i1,i2): return(str(i1)+','+str(i2)) def stringToTwo(couple): return(list(map(int,couple.split(',')))) def nextSquares(x,y,a,b,n): validSquares = [] if x+a < n and y+b < n: validSquares.append(twoIntToString(x+a,y+b)) if x+b < n and y+a < n: validSquares.append(twoIntToString(x+b,y+a)) if x+a < n and y-b >= 0: validSquares.append(twoIntToString(x+a,y-b)) if x+b < n and y-a >= 0: validSquares.append(twoIntToString(x+b,y-a)) if x-a >= 0 and y-b >= 0: validSquares.append(twoIntToString(x-a,y-b)) if x-b >= 0 and y-a >= 0: validSquares.append(twoIntToString(x-b,y-a)) if x-a >= 0 and y+b < n: validSquares.append(twoIntToString(x-a,y+b)) if x-b >= 0 and y+a < n: validSquares.append(twoIntToString(x-b,y+a)) return(validSquares) res = '' for a in range(1,n): for b in range(1,n): squareValue = {'0,0': 0} squareToVisit = ['0,0'] temp = [] giro = 1 while True: squareToVisit = list(map(stringToTwo,squareToVisit)) for couple in squareToVisit: validSquares = nextSquares(couple[0],couple[1],a,b,n) for square in validSquares: if square not in squareValue: squareValue[square] = giro temp.append(square) squareToVisit = temp temp = [] giro += 1 if str(n-1)+','+str(n-1) in squareValue: res += str(squareValue[str(n-1)+','+str(n-1)])+' ' break if squareToVisit == []: res += str(-1)+' ' break print(res) res = ''