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

public class Solution {
    static class P { int x,y,s; P(int x, int y, int s) { this.x=x;this.y=y;this.s=s;}}
    
    static int steps(int i, int j, int n) {
        boolean[][] v = new boolean[n][n]; 
        Queue<P> q = new LinkedList<>();;
        q.add(new P(0,0,0));
        
        while (!q.isEmpty()) {
            P p = q.remove();
            if (v[p.x][p.y]) continue;
            if (p.x==n-1 && p.y==n-1) return p.s;
            v[p.x][p.y]=true;
            
            if (p.x+i<n && p.y+j<n)   q.add(new P(p.x+i,p.y+j,p.s+1));
            if (p.x+i<n && p.y-j>=0)  q.add(new P(p.x+i,p.y-j,p.s+1));
            if (p.x-i>=0 && p.y+j<n)  q.add(new P(p.x-i,p.y+j,p.s+1));
            if (p.x-i>=0 && p.y-j>=0) q.add(new P(p.x-i,p.y-j,p.s+1));

            if (p.y+i<n && p.x+j<n)   q.add(new P(p.y+i,p.x+j,p.s+1));
            if (p.y+i<n && p.x-j>=0)  q.add(new P(p.y+i,p.x-j,p.s+1));
            if (p.y-i>=0 && p.x+j<n)  q.add(new P(p.y-i,p.x+j,p.s+1));
            if (p.y-i>=0 && p.x-j>=0) q.add(new P(p.y-i,p.x-j,p.s+1));
        }
        return -1;
    }
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] r = new int[n][n];
        for (int i=1; i<n; i++) {
            for (int j=i; j<n; j++) {
                r[i][j] = steps(i,j,n);
            }
        }
        for (int i=1; i<n; i++) {
            for (int j=1; j<n; j++) {
                int z=0;
                if (j>=i) z = r[i][j];
                else z = r[j][i];
                System.out.print(z+" ");
            }
            System.out.println();
        }
    }
}