n=eval(input())

while n:

	n-=1

	for j in range(n):print(-~bin(j+1)[::-1].find('1'))
n=eval(input())

while n:

	n-=1

	for j in range(n):print((j+1&~j).bit_length())
n = eval(input())
while n:
    n -= 1
    for j in range(n):
        print(-~bin(j + 1)[::-1].find("1"))

n = eval(input())
while n:
    n -= 1
    for j in range(n):
        print((j + 1 & ~j).bit_length())

-        print(-~bin(j + 1)[::-1].find("1")) +        print((j + 1 & ~j).bit_length())