fun main(args: Array<String>) {
    val N = readLine()!!.toInt()

    val a = Array(N) { Array(N) {0} }

    var k = 1;
    while(1L shl (k - 1) < N) {
        val b = 1 shl (k - 1)

        for (i in 0 until N) {
            for(j in i + 1 until N) {
                if ((i and b) != (j and b)) {
                    a[i][j] = k
                }
            }
        }
        k++
    }

    for(i in 0 until N - 1) {
        println(a[i].slice(i + 1 until N).joinToString(" "))
    }
}