import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[][] result = new int[n][n]; for (int i = 1; i < n; i++) { for (int j = i; j < n; j++) { result[i][j] = getMethod(n, i, j); if (i != j) result[j][i] = result[i][j]; } } for (int i = 1; i < n; i++) { for (int j = 1; j < n; j++) { System.out.print(result[i][j] + " "); } System.out.println(); } } private static int getMethod(int n, int step1, int step2) { int[][] field = new int[n][n]; boolean isGo = true; field[0][0] = 1; int countStep = 2; while (field[n - 1][n - 1] == 0 && isGo) { isGo = false; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (field[i][j] == countStep - 1) { getMoXveStep(step1, step2, countStep, field, i, j, n); isGo = true; } } } countStep++; } return field[n - 1][n - 1] - 1; } private static void getMoXveStep(int step1, int step2, int countStep, int[][] field, int x, int y, int n) { if (x + step1 < n && y + step2 < n && field[x + step1][y + step2] == 0) field[x + step1][y + step2] = countStep; if (x + step1 < n && y - step2 >= 0 && field[x + step1][y - step2] == 0) field[x + step1][y - step2] = countStep; if (x - step1 >= 0 && y + step2 < n && field[x - step1][y + step2] == 0) field[x - step1][y + step2] = countStep; if (x - step1 >= 0 && y - step2 >= 0 && field[x - step1][y - step2] == 0) field[x - step1][y - step2] = countStep; if (x + step2 < n && y + step1 < n && field[x + step2][y + step1] == 0) field[x + step2][y + step1] = countStep; if (x + step2 < n && y - step1 >= 0 && field[x + step2][y - step1] == 0) field[x + step2][y - step1] = countStep; if (x - step2 >= 0 && y + step1 < n && field[x - step2][y + step1] == 0) field[x - step2][y + step1] = countStep; if (x - step2 >= 0 && y - step1 >= 0 && field[x - step2][y - step1] == 0) field[x - step2][y - step1] = countStep; } }