import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {
    private static int count = 0;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        // your code goes here
        for (int i=1;i<n;i++){
            for(int j=1;j<n;j++){
                int numOfMoves = -1;
                //if i and j are same
                if (i==j){
                    if((n-1)%i==0){
                        numOfMoves = (n-1)/i;
                    }
                } else {
                    //
                       count = 0;
                       boolean[][] moves = new boolean[n][n];
                       numOfMoves = findMoves(0, 0, i, j, n-1, moves); 
                }
                System.out.print(numOfMoves + " ");
            }
            //print new line for outer loop
            System.out.println();
        }
    }
    static int findMoves(int x, int y, int i, int j, int n, boolean[][] moves){
        //System.out.println(moves[n-1][n-1]);
        if (moves[n][n]){
            return count;
        } else {
            count++;
            if (x + i <=n && y + j <=n){
                if (!moves[x + i][y + j]){
                    moves[x + i][y + j] = true;
                    return findMoves(x+i, y + j, i, j, n, moves);
                }
            } 
            if (x + j <= n && y + i <= n ){
                if (!moves[x + j][y + i]){
                    moves[x + j][y + i] = true;
                    return findMoves(x + j, y + i, i, j, n, moves);
                }
            }
            if (x + i <=n && y - j>=0){
                if (!moves[x + i][y -j]){
                    moves[x + i][y -j] = true;
                    return findMoves(x+i, y -j, i, j, n, moves);
                }
            } 
            if (x + j <= n && y - i >=0){
                if (!moves[x + j][y - i]){
                    moves[x + j][y - i] = true;
                    return findMoves(x + j, y - i, i, j, n, moves);
                }
            }
            if (x-i >= 0 && y + j <= n) {
                if (!moves[x - i][y + j]){
                    moves[x - i][y + j] = true;
                    return findMoves(x - i, y + j, i, j, n, moves);
                }
            }
            if (x - j>=0 && y + i <=n){
                if (!moves[x-j][y + i]){
                    moves[x-j][y + i] = true;
                    return findMoves(x-j, y + i, i, j, n, moves);
                }
            }
            if (x -i >= 0 &&  y - j >= 0) {
                if (!moves[x - i][y - j]){
                    moves[x - i][y - j] = true;
                    return findMoves(x - i, y - j, i, j, n, moves);
                }
            }

            if (x - j >= 0 && y - i >= 0){
                if (!moves[x-j][y-i]){
                    moves[x-j][y-i] = true;
                    return findMoves(x-j, y - i, i, j, n, moves);
                }
            }
            
            return -1;
        }
    }
}