import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // your code goes here long ans[][] = new long[n][n]; boolean visited[][] = new boolean[n][n]; for( int a = 1; a <= n-1; a++ ){ for( int b = 1; b <= n-1; b++ ){ for( int i = 0; i < n; i++ ){ for( int j = 0; j < n; j++ ){ ans[i][j] = Long.MAX_VALUE/2; visited[i][j] = false; } } ans[0][0] = 0; solve(a,b,n,ans,visited); if( ans[n-1][n-1] >= Long.MAX_VALUE/2 ){ ans[n-1][n-1] = -1; } System.out.print( ans[n-1][n-1] + " "); } System.out.println(); } } public static long solve(int a, int b, int n,long[][] ans,boolean[][] visited){ Queue queue = new LinkedList(); queue.add(new Cell(0,0)); int []px = {1,1,-1,-1,1,1,-1,-1}; int []py = {1,-1,1,-1,1,-1,1,-1}; for( int i = 0; i < 4; i++ ){ px[i] = px[i] * a; py[i] = py[i] * b; } for( int i = 4; i < 8; i++ ){ px[i] = px[i] * b; py[i] = py[i] * a; } while( queue.peek() != null ){ Cell c = queue.remove(); for( int i = 0; i < 8; i++ ){ int p = c.x + px[i]; int q = c.y + py[i]; if( p <= n-1 && p >= 0 && q >= 0 && q <= n-1 && !visited[p][q]){ ans[p][q] = min(ans[p][q],ans[c.x][c.y] + 1); visited[p][q] = true; queue.add(new Cell(p,q)); } } } return ans[n-1][n-1]; } public static long min(long a, long b){ return (a>=b)?b:a; } public static class Cell{ public int x; public int y; public Cell(int x, int y){ this.x = x; this.y = y; } } }