Exam for the Night's Watch#12424

Exam for the Night's Watch

2 seconds
256 megabytes
Hard

Since the times of the Andals and the First Men, the function has been known in Westeros, where is a permutation of arbitrary length. It is defined as follows.

Define the array as follows: d_i = |p_i - p_{i+1}| for all 1 \le i \le m-1, where is the length of the permutation. Then is equal to the number of indices 1 \le i \le m-2 such that d_i \not\equiv d_{i+1} \pmod{2}.

Jon Snow has dreamed since childhood of joining the Night's Watch, so he is going to take the exam. Its essence is to find a permutation of length with the maximum possible value of . However, the examiner, Ser Alliser Thorne, hates Jon Snow and therefore requires that his permutation be lexicographically smallest among all permutations that achieve the maximum value of .

Since Jon Snow knows nothing, he needs your help. Please help him pass the exam for the Night's Watch.

Input

The first line contains an integer (3 \le n \le 2 \cdot 10^5) — the length of the permutation.

Output

Print the lexicographically smallest permutation with the maximum possible value of .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

For the second test:

The array will look like: {1,0,1,0,1}.

Therefore, the required value of is .

Since m-2 = 4, then is the maximum possible value of .

Scoring

  1. Subtask ( points): (n\le 10)

  2. Subtask ( points): (n\le 100)

  3. Subtask ( points): (n\le 1000)

  4. Subtask ( points): No additional constraints