n=int(eval(input()))

ans=[[0]*n for _ in range(n)]

for i in range(n):

  for j in range(n):

    tmp=i^j

    if tmp==0:

      ans[i][j]=1

    else:

      tmp=format(tmp,'b')[::-1]

      ans[i][j]=tmp.index('1')+1

for i in range(n-1):

  print((*ans[i][i+1:]))
def dfs(color,l,r):

  if l==r:

    return

  for i in range(l,(l+r)//2+1):

    for j in range((l+r)//2+1,r+1):

      ans[i][j]=color

  dfs(color+1,l,(l+r)//2)

  dfs(color+1,(l+r)//2+1,r)



n=int(eval(input()))

ans=[[0]*(n+1) for _ in range(n+1)]

dfs(1,1,n)

for i in range(1,n):

  print((*ans[i][i+1:n+1]))
n = int(eval(input()))
ans = [[0] * n for _ in range(n)]
for i in range(n):
    for j in range(n):
        tmp = i ^ j
        if tmp == 0:
            ans[i][j] = 1
        else:
            tmp = format(tmp, "b")[::-1]
            ans[i][j] = tmp.index("1") + 1
for i in range(n - 1):
    print((*ans[i][i + 1 :]))

def dfs(color, l, r):
    if l == r:
        return
    for i in range(l, (l + r) // 2 + 1):
        for j in range((l + r) // 2 + 1, r + 1):
            ans[i][j] = color
    dfs(color + 1, l, (l + r) // 2)
    dfs(color + 1, (l + r) // 2 + 1, r)


n = int(eval(input()))
ans = [[0] * (n + 1) for _ in range(n + 1)]
dfs(1, 1, n)
for i in range(1, n):
    print((*ans[i][i + 1 : n + 1]))

+def dfs(color, l, r): +    if l == r: +        return +    for i in range(l, (l + r) // 2 + 1): +        for j in range((l + r) // 2 + 1, r + 1): +            ans[i][j] = color +    dfs(color + 1, l, (l + r) // 2) +    dfs(color + 1, (l + r) // 2 + 1, r) + + -ans = [[0] * n for _ in range(n)] -for i in range(n): -    for j in range(n): -        tmp = i ^ j -        if tmp == 0: -            ans[i][j] = 1 -        else: -            tmp = format(tmp, "b")[::-1] -            ans[i][j] = tmp.index("1") + 1 -for i in range(n - 1): -    print((*ans[i][i + 1 :])) +ans = [[0] * (n + 1) for _ in range(n + 1)] +dfs(1, 1, n) +for i in range(1, n): +    print((*ans[i][i + 1 : n + 1]))