import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


enum L = 2001;

void main() {
    int n;
    scan(n);

    auto a = new int[][](n, n);
    auto d = new int[](n);
    d[] = n - 1;

    int rm = n * (n - 1) / 2;

    void proc(int i, int lev) {
        auto dis = new int[](n);
        dis[] = inf;
        dis[i] = 0;

        void dfs(int u, int dd) {
            dis[u] = dd;

            foreach (v ; 0 .. n) {
                if (v == u) continue;
                if (dis[v] == inf && a[u][v] == 0) {
                    a[u][v] = a[v][u] = lev;
                    dfs(v, dd + 1);
                    break;
                }
            }
        }

        dfs(i, 0);
        debug {
            writeln(dis);

        }

        foreach (u ; 0 .. n) {
            foreach (v ; u + 1 .. n) {
                if (dis[u] == inf || dis[v] == inf) continue;
                if (abs(dis[u] - dis[v]) % 2) {
                    a[u][v] = a[v][u] = lev;
                    d[u]--;
                    d[v]--;
                    rm--;
                }
            }
        }

        debug {
            writeln(dis);
            writeln(rm);
        }
    }

    int lev = 1;

    while (rm) {
        foreach (i ; 0 .. n) {
            if (d[i] > 0) {
                proc(i, lev);
                break;
            }
        }
        debug {
            writeln(a);
        }
        lev++;
    }

    foreach (i ; 0 .. n - 1) {
        writefln("%(%s %)", a[i][i + 1 .. n]);
    }
}

















void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}
