#!/bin/python3 import sys n = int(input().strip()) # your code goes here def find_reachable_squares(x,y,a,b,n): squares = set() if x+a>=0 and x+a=0 and y+b=0 and y-b=0 and x-a=0 and y+b=0 and y-b=0 and x+b=0 and y+a=0 and y-a=0 and x-b=0 and y+a=0 and y-a0 and (0,0) not in history_sq): reachable_squares = set() count = count + 1 for s in previous_squares: reachable_squares=reachable_squares | find_reachable_squares(s[0],s[1],i,j,n) reachable_squares = reachable_squares -history_sq previous_squares = set() for s in reachable_squares: previous_squares.add(s) history_sq.add(s) val=-1 if (0,0) in history_sq: val = count matrix[i-1][j-1] = val matrix[j-1][i-1] = val for i in matrix: string='' for j in i: string=string+' '+str(j) print(string[1:])