One-Line Notation

Find the lexicographically smallest shortest sequence of distinct labels a1..aN where every pair of labels appears adjacent somewhere, an Eulerian circuit of the complete graph.

Medium7GraphGreedyImplementationCombinatoricsNo attempts yetTime limit1sMemory limit512 MB

Problem

The statement that NN given numbers are all different can be written as a single expression that uses the symbol != several times. For example, A, B, C are all different exactly when (A != B) && (B != C) && (C != A) holds, and the one-line form of that,

A != B != C != A

is called a one-line notation for A, B, C.

Writing the condition that five numbers A, B, C, D, E are all different as

A != B != C != D != E

is not a valid one-line notation. Five numbers are all different only when each of the 10 pairs is said to be different, so at least 10 copies of != are needed. In general, a one-line notation for NN numbers needs at least C(N,2)C(N, 2) copies of !=, where C(N,2)C(N, 2) is the number of ways to choose 2 objects out of NN distinct ones.

More precisely, a one-line notation for a1, a2, ..., aN is a sequence x1x_1, x2x_2, ..., xkx_k of those names, written on one line with != between every two neighbours. For every pair of distinct names uu, vv there must be a position tt with xt=ux_t = u and xt+1=vx_{t+1} = v, or with xt=vx_t = v and xt+1=ux_{t+1} = u. The length of the notation is the number of != symbols, that is k1k - 1.

You are given an odd number NN. Print the shortest one-line notation for a1, a2, ..., aN, and among the shortest ones the lexicographically smallest. Write a single space in place of each !=. For N=3N = 3 the answer is a1 a2 a3 a1. The notation a3 a1 a2 a3 has the same length, but it comes later in lexicographic order, so it is not the answer.

Hint: C(N,2)C(N, 2), the least number of != symbols, equals the number of edges of the complete graph on NN vertices.

Input

The first line contains an odd number NN with 1<N<5001 < N < 500.

Output

Print on the first line the lexicographically smallest one among the shortest one-line notations. Write the names as a1, a2, and separate them with one space. Lexicographic order compares the sequences of subscripts from the front, and subscripts compare as numbers, so a2 comes before a10.