using System;
using System.Collections.Generic;
using System.Text;

public class Program
{
    private int N;

    // 1 黒　-1 白
    private HashSet<int> B, W;
    private int[] Max;

    private HashSet<int>[] Edge;
    private int[][] Ans;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        Max = new int[N];
        Edge = new HashSet<int>[N];
        int cnt = 0;
        for (int i = 0; i < N; i++)
        {
            Edge[i] = new HashSet<int>();
            for (int j = 0; j < N; j++)
            {
                if (i != j)
                    Edge[i].Add(j);
            }
        }

        cnt = N * (N - 1) / 2;
        Ans = new int[N][];
        for (int i = 0; i < N; i++)
        {
            Ans[i] = new int[N];
        }

        while (cnt > 0)
        {
            int start;
            for (start = 0; start < N; start++)
            {
                if (Edge[start].Count > 0)
                    break;
            }

            B = new HashSet<int>();
            W = new HashSet<int>();
            int col = SetCol(start, 1) + 1;
            foreach (int i in B)
            {
                foreach (int j in W)
                {
                    Ans[i][j] = col;
                    Ans[j][i] = col;
                    Max[i] = col;
                    Max[j] = col;
                    cnt--;
                    Edge[i].Remove(j);
                    Edge[j].Remove(i);
                }
            }
        }

        var sb = new StringBuilder();
        for (int i = 0; i < N - 1; i++)
        {
            List<int> line = new List<int>();
            for (int j = i + 1; j < N; j++)
            {
                line.Add(Ans[i][j]);
            }

            sb.AppendLine(string.Join(" ", line));
        }
        Console.Write(sb.ToString());
    }

    private int SetCol(int pos, int col)
    {
        if (B.Contains(pos) || W.Contains(pos))
        {
            return -1;
        }

        if (col == 1)
            B.Add(pos);
        else if (col == -1)
            W.Add(pos);
        int res = Max[pos];
        foreach (int i in Edge[pos])
        {
            res = Math.Max(res, SetCol(i, col * -1));
        }

        return res;
    }


    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 25940