#!/bin/python3 import sys n = int(input().strip()) # For each row... for a in range(1, n): # Keep track of the turns it takes for each combination turn_list = [] # For each column/row combo in each row for b in range(1, n): # Keep track of the position, the number of turns, and which combo number is largest and smallest position = [0, 0] turns = 0 biggest = max(a, b) smallest = min(a, b) # While the position isnt at the end while position != [n-1, n-1]: # If you cannot add the smallest to either axis if position[0] + smallest >= n and position [1] + smallest >= n: turns = -1 position = [n-1, n-1] # If you cannot add the smallest to the second axis elif position[1] + smallest >= n: position = [position[0] + smallest, position[1] - biggest] turns += 1 # If you cannot add the smallest to the first axis elif position[0] + smallest >= n: position = [position[0] - biggest, position[1] + smallest] turns += 1 # If you can add the biggest to the first axis elif position[0] + biggest < n: position = [position[0] + biggest, position[1] + smallest] turns += 1 # If you can add the smallest to the first axis elif position[0] + smallest < n: position = [position[0] + smallest, position[1] + biggest] turns += 1 # If you can add the smallest to the second axis elif position[1] + smallest < n: position = [position[0] - biggest, position[1] + smallest] turns += 1 turn_list.append(str(turns)) print(" ".join(turn_list))