import sys # from (0,0) to (n-1,n-1) # x = x +- i # y = y +- j def getmoves(i, j, n): board = [[0 for _ in range(n)] for _ in range(n)] queue = [[0,0,0]] board[0][0] = 1 count = -1 while len(queue) != 0: x,y,c = queue.pop(0) if x == n-1 and y == n-1: count = c break if x+i < n: if y+j < n and board[x+i][y+j] == 0: queue.append([x+i, y+j, c+1]) board[x+i][y+j] = 1 if y-j >= 0 and board[x+i][y-j] == 0: queue.append([x+i, y-j, c+1]) board[x+i][y-j] = 1 if x-i >= 0: if y+j < n and board[x-i][y+j] == 0: queue.append([x-i, y+j, c+1]) board[x-i][y+j] = 1 if y-j >= 0 and board[x-i][y-j] == 0: queue.append([x-i, y-j, c+1]) board[x-i][y-j] = 1 if x+j < n: if y+i < n and board[x+j][y+i] == 0: queue.append([x+j, y+i, c+1]) board[x+j][y+i] = 1 if y-i >= 0 and board[x+j][y-i] == 0: queue.append([x+j, y-i, c+1]) board[x+j][y-i] = 1 if x-j >= 0: if y+i < n and board[x-j][y+i] == 0: queue.append([x-j, y+i, c+1]) board[x-j][y+i] = 1 if y-i >= 0 and board[x-j][y-i] == 0: queue.append([x-j, y-i, c+1]) board[x-j][y-i] = 1 return count n = int(raw_input().strip()) moves = [[0]*(n-1) for _ in range(n-1)] for i in xrange(1,n): for j in xrange(i,n): moves[i-1][j-1] = getmoves(i,j,n) moves[j-1][i-1] = moves[i-1][j-1] print '\n'.join(' '.join(map(str, m)) for m in moves)