import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static int[][] board; private static int[] xd = { -1, 1, 1, -1 }; private static int[] yd = { -1, -1, 1, 1 }; private static int n; public static void main(String[] args) { Scanner scan = new Scanner(System.in); n = scan.nextInt(); board = new int[n][n]; for(int i = 1; i < n; i++){ for(int j = 1; j < n; j++){ System.out.print(traverse(i, j) + " "); } System.out.println(); } } public static int traverse(int a, int b) { for(int i = 0; i < n; i++){ Arrays.fill(board[i], Integer.MAX_VALUE); } Queue q = new LinkedList<>(); q.add(0); q.add(0); board[0][0] = 0; while(!q.isEmpty()){ int x = q.poll(); int y = q.poll(); for(int i = 0; i < 4; i++){ int a1 = x + xd[i] * a; int b1 = y + yd[i] * b; if(a1 < n && b1 < n && a1 >= 0 && b1 >= 0 && board[a1][b1] == Integer.MAX_VALUE){ board[a1][b1] = board[x][y] + 1; q.add(a1); q.add(b1); } int a2 = y + yd[i] * a; int b2 = x + xd[i] * b; if(a2 < n && b2 < n && a2 >= 0 && b2 >= 0 && board[a2][b2] == Integer.MAX_VALUE){ board[a2][b2] = board[x][y] + 1; q.add(a2); q.add(b2); } } } if(board[n - 1][n - 1] == Integer.MAX_VALUE){ return -1;} return (board[n - 1][n - 1]); } }