class Queue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def enqueue(self, item): self.items.insert(0,item) def dequeue(self): return self.items.pop() def size(self): return len(self.items) def valid_node(n, node): if node[0] >= n or node[0] < 0: return False if node[1] >= n or node[1] < 0: return False return True def calculateM(n, node, a, b): x = node[0] y = node[1] bar = [] bar.append((x+a, y+b)) bar.append((x+a, y-b)) bar.append((x-a, y+b)) bar.append((x-a, y-b)) bar.append((x+b, y+a)) bar.append((x+b, y-a)) bar.append((x-b, y+a)) bar.append((x-b, y-a)) return bar def BFS(n, a, b): seen = {} parent = {} worklist = Queue() worklist.enqueue((0,0)) while worklist.size() != 0: node = worklist.dequeue() if node in seen: continue seen[node] = True for neib in calculateM(n, node, a, b): if valid_node(n, neib) and neib not in seen: worklist.enqueue(neib) parent[neib] = node else: continue if (n-1, n-1) in seen: ans = retrace(n, parent) return ans else: return -1 def retrace(n, parent): count = 0 node = (n-1, n-1) while node in parent: p = parent[node] count += 1 if p == (0,0): return count else: node = p def solution(n, a, solved): ans = [] for b in range(1, n): if (a, b) in solved: ans.append(solved[(a,b)]) elif (b, a) in solved: ans.append(solved[(b, a)]) else: dis = (BFS(n, a, b)) solved[(a, b)] = dis ans.append(dis) return ans n = int(input()) solved = dict() for i in range(1, n): ans = solution(n, i, solved) print(str(ans)[1:-1].replace(",",""))