Problem:
Score: 600 points

Problem Statement

AtCoder's head office consists of N rooms numbered 1 to N. For any two rooms, there is a direct passage connecting these rooms.

For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and must satisfy the following condition:

For each room i\ (1 \leq i \leq N), if we leave Room i, pass through some passages whose levels are all equal and get back to Room i, the number of times we pass through a passage is always even.

Your task is to set levels to the passages so that the highest level of a passage is minimized.

Constraints

N is an integer between 2 and 500 (inclusive).

Input

Input is given from Standard Input in the following format:

N

Output

Print one way to set levels to the passages so that the objective is achieved, as follows:

a_{1,2} a_{1,3} ... a_{1,N}
a_{2,3} ... a_{2,N}
.
.
.
a_{N-1,N}

Here a_{i,j} is the level of the passage connecting Room i and Room j.

If there are multiple solutions, any of them will be accepted.

Sample Input 1

3

Sample Output 1

1 2
1

The following image describes this output:

For example, if we leave Room 2, traverse the path 2 \to 3 \to 2 \to 3 \to 2 \to 1 \to 2 while only passing passages of level 1 and get back to Room 2, we pass through a passage six times.

Solution in Python (3.4.3) (judge verdict: Wrong Answer)

n=int(input())
l=[1, 2, 1, 3, 1, 2, 4, 1, 5, 1, 2, 3, 6, 1, 7, 1, 2, 4, 8, 1, 3, 9, 1, 2, 5, 10, 1, 11, 1, 2, 3, 4, 6, 12, 1, 13, 1, 2, 7, 14, 1, 3, 5, 15, 1, 2, 4, 8, 16, 1, 17, 1, 2, 3, 6, 9, 18, 1, 19, 1, 2, 4, 5, 10, 20, 1, 3, 7, 21, 1, 2, 11, 22, 1, 23, 1, 2, 3, 4, 6, 8, 12, 24, 1, 5, 25, 1, 2, 13, 26, 1, 3, 9, 27, 1, 2, 4, 7, 14, 28, 1, 29, 1, 2, 3, 5, 6, 10, 15, 30, 1, 31, 1, 2, 4, 8, 16, 32, 1, 3, 11, 33, 1, 2, 17, 34, 1, 5, 7, 35, 1, 2, 3, 4, 6, 9, 12, 18, 36, 1, 37, 1, 2, 19, 38, 1, 3, 13, 39, 1, 2, 4, 5, 8, 10, 20, 40, 1, 41, 1, 2, 3, 6, 7, 14, 21, 42, 1, 43, 1, 2, 4, 11, 22, 44, 1, 3, 5, 9, 15, 45, 1, 2, 23, 46, 1, 47, 1, 2, 3, 4, 6, 8, 12, 16, 24, 48, 1, 7, 49, 1, 2, 5, 10, 25, 50, 1, 3, 17, 51, 1, 2, 4, 13, 26, 52, 1, 53, 1, 2, 3, 6, 9, 18, 27, 54, 1, 5, 11, 55, 1, 2, 4, 7, 8, 14, 28, 56, 1, 3, 19, 57, 1, 2, 29, 58, 1, 59, 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 1, 61, 1, 2, 31, 62, 1, 3, 7, 9, 21, 63, 1, 2, 4, 8, 16, 32, 64, 1, 5, 13, 65, 1, 2, 3, 6, 11, 22, 33, 66, 1, 67, 1, 2, 4, 17, 34, 68, 1, 3, 23, 69, 1, 2, 5, 7, 10, 14, 35, 70, 1, 71, 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72, 1, 73, 1, 2, 37, 74, 1, 3, 5, 15, 25, 75, 1, 2, 4, 19, 38, 76, 1, 7, 11, 77, 1, 2, 3, 6, 13, 26, 39, 78, 1, 79, 1, 2, 4, 5, 8, 10, 16, 20, 40, 80, 1, 3, 9, 27, 81, 1, 2, 41, 82, 1, 83, 1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84, 1, 5, 17, 85, 1, 2, 43, 86, 1, 3, 29, 87, 1, 2, 4, 8, 11, 22, 44, 88, 1, 89, 1, 2, 3, 5, 6, 9, 10, 15, 18, 30, 45, 90, 1, 7, 13, 91, 1, 2, 4, 23, 46, 92, 1, 3, 31, 93, 1, 2, 47, 94, 1, 5, 19, 95, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96, 1, 97, 1, 2, 7, 14, 49, 98, 1, 3, 9, 11, 33, 99, 1, 2, 4, 5, 10, 20, 25, 50, 100, 1, 101, 1, 2, 3, 6, 17, 34, 51, 102, 1, 103, 1, 2, 4, 8, 13, 26, 52, 104, 1, 3, 5, 7, 15, 21, 35, 105, 1, 2, 53, 106, 1, 107, 1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 108, 1, 109, 1, 2, 5, 10, 11, 22, 55, 110, 1, 3, 37, 111, 1, 2, 4, 7, 8, 14, 16, 28]
for i in range(n):
    print(*l[:n-i-1])